30

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
  • 5,485
  • 8
  • 46
  • 75
  • 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

2 Answers2

24

Use:

docker images

to see it

Example:

REPOSITORY     TAG                 IMAGE ID            CREATED             SIZE
sample         latest              c660b762fcd1        5 days ago          1.46GB
Tim Cooper
  • 151,519
  • 37
  • 317
  • 271
Carlos Rafael Ramirez
  • 5,552
  • 1
  • 25
  • 34
  • 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
6

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

k26dr
  • 1,069
  • 16
  • 14