Big. D
Big. D

Reputation: 31

Dockerfile - Creating dockerfile

I'm trying to pull tomcat from the Dockerfile I have created and pull centos using the command:

FROM centos
RUN docker run -it tomcat

Then now I'm creating a new Dockerfile, how do I pull the tomcat from the Dockerfile I've created above without pulling from the Docker Hub?

Upvotes: 0

Views: 129

Answers (1)

eLRuLL
eLRuLL

Reputation: 18799

First you need to build your Dockerfile into a docker image:

docker build -t my-custom-image .

Now you can base another docker container from the image you created, just like you were doing with centos:

FROM my-custom-image

Upvotes: 2

Related Questions