35

I'm trying to build a sample docker image. When I run the following command:

docker build -t sample .

Where does the docker image go?

Here is my Dockerfile:

FROM node:boron

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install

# Bundle app source
COPY . /usr/src/app

EXPOSE 8080
CMD [ "npm", "start" ]
Zeus82
  • 6,065
  • 9
  • 53
  • 77
  • 1
    I believe it answers your question: http://stackoverflow.com/questions/19234831/where-are-docker-images-stored-on-the-host-machine – Juliano Alves Jan 19 '17 at 15:19

3 Answers3

26

Use:

docker images

to see it

Example:

REPOSITORY     TAG                 IMAGE ID            CREATED             SIZE
sample         latest              c660b762fcd1        5 days ago          1.46GB
Carlos Rafael Ramirez
  • 5,984
  • 1
  • 29
  • 36
  • 1
    I swear these were not showing up in my Docker Desktop application, but running the command from the directory I ran the build from seems to show them. Now they are showing in Docker Desktop I noticed in VSCode with the Docker extension you have to click the option for "Show dangling images" if none are showing up there, but show up when you run `docker images`. – CTS_AE Dec 02 '21 at 21:00
8

They get stored as a series of layers in your Docker root directory. On Linux, it's /var/lib/docker.

k26dr
  • 1,229
  • 18
  • 15
0

after building you docker image run

docker image ls

then pick the image name you are interested (from first column) and run

docker image inspect <image name>

you will see there is about that image including location

pref
  • 1,651
  • 14
  • 24