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.

1187 questions
13
votes
3 answers

Why does my non-volume data in Docker container persist even after restarting the container?

In some places when I read about Docker containers, I found some people talking that they lose their data (saved inside the container and not a part of volume data) when they restart the container. I tried to create a simple Ubuntu container like…
Mohammed Noureldin
  • 14,913
  • 17
  • 70
  • 99
13
votes
2 answers

How can a container identify which container it is in a set of a scaled docker-compose service?

I have a docker container called node that I want to scale to n containers. A given node container needs to know which container it is in the set of n scaled node containers. The total could be in an environment variable, but the current is more…
luckydonald
  • 5,976
  • 4
  • 38
  • 58
13
votes
1 answer

Docker: Use sockets for communication between 2 containers

I have 2 Docker containers: App & Web. App — simple container with php application code. It is used only for storage and deliver the code to the remote Docker host. App image Dockerfile: FROM debian:jessie COPY . /var/www/app/ VOLUME…
Alex Fatyeev
  • 131
  • 1
  • 1
  • 4
12
votes
3 answers

Docker - accessing files inside container from host

I am new to docker. I ran a node-10 images and inside the running container I cloned a repository, ran the app which started a server with file watcher. I need to access the codebase inside the container, open it up in an IDE running on the windows…
VISHAL DAGA
  • 4,132
  • 10
  • 47
  • 53
12
votes
2 answers

Docker Inside a Docker on Windows

I have seen docker inside docker docker container for Ubuntu/Linux. As per the replies in this thread, the following command works docker run -v /var/run/docker.sock:/run/docker.sock -v $(which docker):/bin/docker [your image Are there any similar…
panch
  • 305
  • 3
  • 12
12
votes
2 answers

Docker - Create new files as www-data and not root

I have a basic docker container which I build using docker-compose (version 3) to bring up a basic LAMP stack. The issue I am having is that files created inside the docker container are always owned by root, so I am unable to edit them locally. I…
Rooneyl
  • 7,802
  • 6
  • 52
  • 81
12
votes
4 answers

extend jenkins image to install maven

I'm using the jenkins/jenkins:lts image at the moment. It runs fine and does everything I want to expect one thing. I want it to run Maven goals in the build steps. The problem is that there is not maven installed in the jenkins container…
xetra11
  • 7,671
  • 14
  • 84
  • 159
12
votes
2 answers

How to access "http://localhost" from a Docker container in Windows?

I have a set of containers running in Windows 10 with Docker, this is the output of docker-compose ps: > docker-compose ps Name Command State …
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
12
votes
2 answers

Docker difference between two containers

How do I find the difference between two running containers using Docker client? I have an image running as multiple instances and later I have changed/installed new packages in the instances and lost track. Is there a way I can find the…
user88975
  • 610
  • 1
  • 9
  • 18
11
votes
1 answer

Why do I have to delete docker containers?

What artifacts do stopped docker containers leave on the host file system that makes it necessary to run the command "docker container prune". I thought docker containers where simply running versions of images that are suppose to be wiped out after…
user2561417
  • 295
  • 4
  • 13
11
votes
3 answers

How to obtain container id base on docker image name via command line ?

If I ran sudo doccker ps I got this [user@vm1 ~]$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e8ff73dec1d5 …
Tiffany Soun
  • 523
  • 3
  • 9
  • 18
11
votes
1 answer

Docker Connecting PHP container to MySQL

I have two containers, a apache-php container, and a mysql db container. I am trying to get my php script to query my sql database. I am however receiving the following errors; Fatal error: Uncaught PDOException: PDO::__construct():…
John Mack
  • 195
  • 1
  • 1
  • 6
11
votes
1 answer

How to configure a Docker container for acquiring DHCP IP/s from dhcp server running on ESX

My host is SLES12 VM running on an ESX server. VM Host has interfaces which acquire DHCP IPs from the DHCP server running on ESX. In my docker container (docker image: opensuse) I am running a NFS server and hence need external access. I want the…
Anupam
  • 111
  • 1
  • 1
  • 4
11
votes
2 answers

Restart docker with different environment variable

I have a docker-compose that has myimage: image: myimage:latest environment: MY_VAR: "something" the container uses MY_VAR internally, and sometimes in automated testing I'd like to restart that specific container with a different MY_VAR…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
11
votes
1 answer

docker-compose restart container if service is dead

Is it possible to restart container in docker-compose if service that is running inside it returns exit code different than 0? docker-compose.yml option restart: always doesn't work that way. Is there any way to solve it or is this a service issue…
Thomas
  • 741
  • 4
  • 9
  • 20