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" ]
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.
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.
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.
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.
Use:
docker images
to see it
Example:
REPOSITORY TAG IMAGE ID CREATED SIZE sample latest c660b762fcd1 5 days ago 1.46GB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With