Answer the question
In order to leave comments, you need to log in
Why are two separate images created in Docker?
I have created a Dockerfile, building an image using a Dockerfile.
[email protected]:/var/lib/docker/Source# sudo docker build -t obraz .
docker images
I get two separate images. docker images
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get --yes update; apt-get --yes upgrade; apt-get --yes install software-properties-common
RUN sudo apt-add-repository --yes ppa:webupd8team/java; apt-get --yes update
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
apt-get --yes install curl oracle-java8-installer ; apt-get clean
RUN chmod +x /start
EXPOSE 80
VOLUME ["/data"]
CMD ["/start"]
Answer the question
In order to leave comments, you need to log in
In the first case, you collect the image on your computer. The first line in your dockerfile says that the image is based on the ubuntu:16.04 image, so it is first downloaded and then used to build the image. In the second case, you do not build the image on your computer, but download the finished one from the dockerhub.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question