Questions tagged [docker-image]

A Docker image is an inert, immutable, file that's essentially a snapshot of a Linux container. Images are created with the 'docker build' command or 'docker container' command. Images will produce a container when started with 'docker run'. Images are stored in a Docker registry such as registry.hub.docker.com

A docker image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment.

1026 questions
1220
votes
31 answers

What is the difference between a Docker image and a container?

When using Docker, we start with a base image. We boot it up, create changes and those changes are saved in layers forming another image. So eventually I have an image for my PostgreSQL instance and an image for my web application, changes to which…
Bibek Shrestha
  • 32,848
  • 7
  • 31
  • 34
1084
votes
31 answers

How to remove old and unused Docker images

When running Docker for a long time, there are a lot of images in system. How can I remove all unused Docker images at once safety to free up the storage? In addition, I also want to remove images pulled months ago, which have the correct TAG. So,…
Quanlong
  • 24,028
  • 16
  • 69
  • 79
1023
votes
31 answers

Where are Docker images stored on the host machine?

I managed to find the containers under directory /var/lib/docker/containers, but I can't find the images. What are the directories and files under /var/lib/docker?
nemo
  • 12,241
  • 3
  • 21
  • 26
742
votes
12 answers

Run a Docker image as a container

After building a Docker image from a dockerfile, I see the image was built successfully, but what do I do with it? Shouldn't i be able to run it as a container?
boom
  • 10,856
  • 9
  • 43
  • 64
556
votes
23 answers

Docker container will automatically stop after "docker run -d"

According to tutorial I read so far, use "docker run -d" will start a container from image, and the container will run in background. This is how it looks like, we can see we already have container id. root@docker:/home/root# docker run -d…
J John
  • 5,591
  • 3
  • 11
  • 9
357
votes
10 answers

docker run

I'm trying to run MULTIPLE commands like this. docker run image cd /path/to/somewhere && python a.py But this gives me "No such file or directory" error because it is interpreted as... "docker run image cd /path/to/somewhere" && "python a.py" It…
ai0307
  • 4,037
  • 2
  • 13
  • 21
283
votes
14 answers

How to keep Docker container running after starting services?

I've seen a bunch of tutorials that seem do the same thing I'm trying to do, but for some reason my Docker containers exit. Basically, I'm setting up a web-server and a few daemons inside a Docker container. I do the final parts of this through a…
Eli
  • 36,793
  • 40
  • 144
  • 207
279
votes
25 answers

Can’t delete docker image with dependent child images

I am trying docker rmi c565603bc87f Error: Error response from daemon: conflict: unable to delete c565603bc87f (cannot be forced) - image has dependent child images So i can't delete image even with -f flag. How to delete image then and all of…
YakovlevRoman
  • 3,362
  • 3
  • 19
  • 19
240
votes
21 answers

Stopping Docker containers by image name - Ubuntu

On Ubuntu 14.04 (Trusty Tahr) I'm looking for a way to stop a running container and the only information I have is the image name that was used in the Docker run command. Is there a command to find all the matching running containers that match…
Collin Estes
  • 5,577
  • 7
  • 51
  • 71
225
votes
12 answers

Finding the layers and layer sizes for each Docker image

For research purposes I'm trying to crawl the public Docker registry ( https://registry.hub.docker.com/ ) and find out 1) how many layers an average image has and 2) the sizes of these layers to get an idea of the distribution. However I studied the…
user134589
  • 2,499
  • 2
  • 16
  • 12
155
votes
2 answers

In Docker image names what is the difference between Alpine, Jessie, Stretch, and Buster?

I am just looking at docker images in https://hub.docker.com/_/node/ For every version, the images are categorized into Alpine, Jessie, Stretch, Buster etc. What's their meaning?
Muthukumar
  • 8,679
  • 17
  • 61
  • 86
149
votes
9 answers

Is there a way to combine Docker images into 1 container?

I have a few Dockerfiles right now. One is for Cassandra 3.5, and it is FROM cassandra:3.5 I also have a Dockerfile for Kafka, but t is quite a bit more complex. It is FROM java:openjdk-8-fre and it runs a long command to install Kafka and…
David
  • 7,028
  • 10
  • 48
  • 95
133
votes
4 answers

How to view logs for a docker image?

In the docker world, one can easily see logs for docker container (that is, a running image). But during image creation, one usually issues multiple commands. For example npm install commands in node projects. It would be beneficial to see logs for…
Ville Miekk-oja
  • 18,749
  • 32
  • 70
  • 106
123
votes
9 answers

Cannot remove images even though no container is running

I had multiple stopped containers and images on my machine. I want to clean up and remove all containers: docker ps -a returns nothing. I run docker rmi $(docker images -q) to remove the cached images but I get: Error response from daemon:…
Jim
  • 3,845
  • 3
  • 22
  • 47
119
votes
22 answers

Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error

I want to create a docker image. This is my work directory: Dockerfile.in test.json test.py And this is my Dockerfile: COPY ./test.json /home/test.json COPY ./test.py /home/test.py RUN python test.py When i launch this command: docker build…
EdoBen
  • 1,676
  • 2
  • 14
  • 24
1
2 3
68 69