40

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" ]
1

3 Answers 3

32

Use:

docker images

to see it

Example:

REPOSITORY     TAG                 IMAGE ID            CREATED             SIZE
sample         latest              c660b762fcd1        5 days ago          1.46GB
Sign up to request clarification or add additional context in comments.

1 Comment

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.
9

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

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.