Questions tagged [docker-container]

Docker Containers are the core of the docker platform in which programs and applications can be packaged and run in simulated environments.

Docker containers are the core of the docker program in which programs and applications can run in simulated environments.

These containers serve as a way to simulate code that would otherwise cause irreversible changes to a systems hardware. The difference between this and a virtual machine is that the docker container does not run code on the same level as the virtual machine on top of the fact that it is a lot more portable.

Docker containers can be loaded with any type of environment, even your currently used machine, or serve as simple tool boxes for your file sytems.

For more info, see the official documentation of a docker container.

863 questions
2093
votes
21 answers

Docker: Copying files from Docker container to host

I'm thinking of using Docker to build my dependencies on a Continuous Integration (CI) server, so that I don't have to install all the runtimes and libraries on the agents themselves. To achieve this I would need to copy the build artifacts that…
user2668128
  • 29,912
  • 8
  • 23
  • 30
1874
votes
45 answers

How to copy files from host to Docker container?

I am trying to build a backup and restore solution for the Docker containers that we work with. I have Docker base image that I have created, ubuntu:base, and do not want have to rebuild it each time with a Docker file to add files to it. I want to…
user3001829
  • 19,124
  • 5
  • 15
  • 21
1426
votes
26 answers

How do I get into a Docker container's shell?

I'm getting started working with Docker. I'm using the WordPress base image and docker-compose. I'm trying to ssh into one of the containers to inspect the files/directories that were created during the initial build. I tried to run docker-compose…
Andrew
  • 196,883
  • 184
  • 487
  • 673
1051
votes
28 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
  • 25,573
  • 7
  • 29
  • 33
1022
votes
15 answers

How to deal with persistent storage (e.g. databases) in Docker

How do people deal with persistent storage for your Docker containers? I am currently using this approach: build the image, e.g. for PostgreSQL, and then start the container with docker run --volumes-from c0dbc34fd631 -d app_name/postgres IMHO,…
juwalter
  • 11,022
  • 4
  • 17
  • 16
419
votes
16 answers

How to access host port from docker container

I have a docker container running jenkins. As part of the build process, I need to access a web server that is run locally on the host machine. Is there a way the host web server (which can be configured to run on a port) can be exposed to the…
Tri Nguyen
  • 6,675
  • 6
  • 32
  • 62
346
votes
10 answers

How to rebuild docker container in docker-compose.yml?

There are scope of services which defined in docker-compose.yml. These service have been started. I need to rebuild only one of these and start it without up other services. I run the following commands: docker-compose up -d # run all…
yuklia
  • 4,387
  • 4
  • 16
  • 24
152
votes
3 answers

How to assign more memory to docker container

As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any special flags, there's a memory limit of 2GB (even…
kane
  • 4,242
  • 3
  • 31
  • 52
131
votes
5 answers

docker run: why use --rm (docker newbie)

I am trying docker for the first time and do not yet have a "mental model". Total beginner. All the examples that I am looking at have included the --rm flag to run, such as docker run -it --rm ... docker container run -it --rm ... Question: Why…
matchingmoments
  • 1,507
  • 2
  • 6
  • 7
118
votes
9 answers

image is being used by stopped container

I am trying to delete a docker container by this command: docker rmi Obviously, I have replaced the Image-Id by the Id I get using: docker images But I see the error below: Error response from daemon: conflict: unable to delete…
Mehrdad Babaki
  • 7,301
  • 12
  • 39
  • 59
99
votes
14 answers

Docker - Container is not running

I'm completely a newbie to docker. I tried to start a exited container like follows, I listed down all available containers using docker ps -a. It listed the following: I entered the following commands to start the container which is in the…
Stranger
  • 8,910
  • 14
  • 66
  • 106
86
votes
3 answers

docker-compose creating multiple instances for the same image

I need to start multiple containers for the same image. If i create my compose file as shown below, it works fine. version: '2' services: app01: image: app app02: image: app app03: image: app app04: image: app app05: …
KitKarson
  • 3,802
  • 7
  • 36
  • 63
67
votes
2 answers

How to determine what containers use the docker volume?

Suppose I have a volume and I know its name or id. I want to determine the list of containers (their names or ids) that use the volume. What commands can I use to retrieve this information? I thought it can be stored in the output of docker volume…
gerichhome
  • 1,142
  • 1
  • 9
  • 20
63
votes
8 answers

Can not remove images even though no container is running

I had multiple stopped containers and images in my machine. I wanted to clean up and removed 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
  • 2,341
  • 1
  • 11
  • 23
41
votes
6 answers

docker on ubuntu 16.04 error when killing container

I can't kill or stop any docker container. I've allowed non-privileged users to run Docker commands. And docker run hello-world works fine. But I can't stop any other container. I got following: $ docker stop 59e3b815d1dc Error response from daemon:…
Peter
  • 981
  • 2
  • 9
  • 19
1
2 3
57 58