Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the output for "docker -build" go?

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" ] 
like image 878
Zeus82 Avatar asked Jan 19 '17 14:01

Zeus82


People also ask

What happens during docker build?

The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in the specified PATH or URL . The build process can refer to any of the files in the context. For example, your build can use a COPY instruction to reference a file in the context.

Where does docker build store images on Windows?

In a default installation, layers are stored in C:\ProgramData\docker and split across the "image" and "windowsfilter" directories. You can change where the layers are stored using the docker-root configuration, as demonstrated in the Docker Engine on Windows documentation. Only NTFS is supported for layer storage.

Where are the docker build logs?

Each log file contains information about only one container and is in JSON format. Remember, one log file per container. You find these JSON log files in the /var/lib/docker/containers/ directory on a Linux Docker host.

How can you view the output from a running container?

docker logs <container id> will show you all the output of the container run. If you're running it on ECS, you'll probably need to set DOCKER_HOST=tcp://ip:port for the host that ran the container. My container is already stopped. Using the cmd line doing, docker run -d image, it returns me the container id.


1 Answers

Use:

docker images 

to see it

Example:

REPOSITORY     TAG                 IMAGE ID            CREATED             SIZE sample         latest              c660b762fcd1        5 days ago          1.46GB 
like image 156
Carlos Rafael Ramirez Avatar answered Oct 03 '22 02:10

Carlos Rafael Ramirez