Our company is planning to block Docker hub in our network and to use our on prem Artifactory Pro as our docker registry. I got tasked to change all the Dockerfiles which uses a parent image from Docker hub (eg. FROM 9.0.20-jdk11-slim ...) into artifactory versions of those images.
eg:
FROM tomcat:9.0.20-jdk11-slim
RUN apt-get update && \
apt-get install -y nginx && \
apt-get install -y python3 && \
apt-get -y install ant
CMD ["ant"]
I already downloaded the images needed.. eg:
docker pull tomcat:9.0.20-jdk11-slim
docker save tomcat:9.0.20-jdk11-slim > tomcatjdk11_slim.tar
how do I make these available in Artifactory Pro so I could change the Dockerfile
See this, I copy some main idea from official document.
I guess for your case, Artifactory Pro
as your docker registry already there, so no need to new one(STEP 1), then, you just need to push the image from dockerhub to your new local registry.
1. Run a local registry
$ docker run -d -p 5000:5000 --restart=always --name registry registry:2
2. Copy an image from Docker Hub to your registry
$ docker pull ubuntu:16.04
$ docker tag ubuntu:16.04 localhost:5000/my-ubuntu
$ docker push localhost:5000/my-ubuntu
$ docker image remove ubuntu:16.04
$ docker image remove localhost:5000/my-ubuntu
$ docker pull localhost:5000/my-ubuntu