32,398 questions
1394
votes
29
answers
1.9m
views
How to fix Docker: Permission denied
I installed Docker on my Ubuntu machine.
When I run
sudo docker run hello-world
it works.
But if I write the command without sudo
docker run hello-world
it displays the following:
docker: Got ...
1035
votes
5
answers
759k
views
What is the difference between ports and expose in docker-compose?
What is the difference between ports and expose options in docker-compose.yml?
706
votes
15
answers
1.3m
views
How to rebuild docker container in docker-compose.yml? [closed]
There are scope of services which are defined in docker-compose.yml. These services have been started. I need to rebuild only one of these and start it without up other services.
I run the following ...
684
votes
36
answers
473k
views
How can I use local Docker images with Minikube?
I have several Docker images that I want to use with Minikube. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?
...
679
votes
13
answers
363k
views
What's the difference between Docker Compose vs. Dockerfile
I have been reading up and learning about Docker, and am trying to correctly choose the Django setup to use. So far there is either:
Docker Compose or Dockerfile
I understand that Dockerfiles are used ...
628
votes
13
answers
542k
views
How to restart a single container with docker-compose
I have a docker-compose.yml file that contains 4 containers: redis, postgres, api and worker.
During the development of the worker container, I often need to restart it in order to apply changes. Is ...
607
votes
27
answers
924k
views
Docker: How to clear the logs properly for a Docker container? [closed]
I use docker logs [container-name] to see the logs of a specific container.
Is there an elegant way to clear these logs?
543
votes
21
answers
1.1m
views
How can I use environment variables in docker-compose?
I would like to be able to use environment variables inside docker-compose.yml, with values passed in at the time of docker-compose up. This is the example.
I am doing this today with a basic docker ...
491
votes
28
answers
625k
views
Is it safe to clean docker/overlay2/
I got some docker containers running on AWS EC2, the /var/lib/docker/overlay2 folder grows very fast in disk size.
I'm wondering if it is safe to delete its content?
or if docker has some kind of ...
459
votes
4
answers
388k
views
Difference between links and depends_on in docker_compose.yml
According to the Docker Compose's compose-file documentation:
depends_on - Express dependency between services.
links - Link to containers in another service and also express dependency between ...
448
votes
5
answers
160k
views
What's the difference between Docker Compose and Kubernetes?
While diving into Docker, Google Cloud and Kubernetes, and without clearly understanding all three of them yet, it seems to me these products are overlapping, yet they're not compatible.
For example, ...
430
votes
7
answers
476k
views
How to persist data in a dockerized postgres database using volumes
My docker compose file has three containers, web, nginx, and postgres. Postgres looks like this:
postgres:
container_name: postgres
restart: always
image: postgres:latest
volumes:
- ./...
384
votes
4
answers
174k
views
What is the difference between docker and docker-compose
docker and docker-compose seem to be interacting with the same dockerFile, what is the difference between the two tools?
344
votes
43
answers
1.1m
views
Docker Error bind: address already in use
When I run docker-compose up in my Docker project it fails with the following message:
Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: address already in use
netstat -pna | grep 3000
...
334
votes
12
answers
518k
views
How do I make a Docker container start automatically on system boot?
Supposed I have a Docker container that I want to run, then I can call
$ docker run ...
and everything is fine. Is there a built-in way to run a container in a way that it will be restarted ...
320
votes
10
answers
410k
views
How to run docker-compose up -d at system start up?
To let the containers autostart at startup point, I tried to add the command:
cd directory_has_docker-compose.yml && docker-compose up -d
in /etc/rc.local
but then after I rebooted the ...
311
votes
2
answers
368k
views
How to pass arguments to a Dockerfile?
I am using RUN instruction within a Dockerfile to install a rpm
RUN yum -y install samplerpm-2.3
However, I want to pass the value "2.3" as an argument.
My RUN instruction should look something like:
...
296
votes
13
answers
351k
views
What is the best way to pass AWS credentials to a Docker container?
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
293
votes
24
answers
574k
views
How to upgrade docker-compose to latest version
I have installed docker-compose using the command
sudo apt install docker-compose
It installed docker-compose version 1.8.0 and build unknown
I need the latest version of docker-compose or at least a ...
288
votes
10
answers
175k
views
Is there any way to disable a service in docker-compose.yml [closed]
I find myself in the situation, that I want to disable a service temporarily in a docker-compose file.
Of course I could comment it out, but is there any option to just say "enabled: false" ?
280
votes
19
answers
476k
views
how to get docker-compose to use the latest image from repository
I don't know what I'm doing wrong, but I simply cannot get docker-compose up to use the latest image from our registry without first removing the old containers from the system completely. It looks ...
262
votes
9
answers
337k
views
How to tag docker image with docker-compose
I want to build image via docker-compose and set specific tag to it. Documentation says:
Compose will build and tag it with a generated name, and use that
image thereafter.
But I can't find a way ...
256
votes
34
answers
360k
views
Can't connect to docker from docker-compose
I installed docker-machine 0.1.0 and docker-compose 1.1.0 on Mac OS 10.8.5.Docker-machine is running normally and able to connect by docker-machine ssh.
$ docker-machine ls
NAME ACTIVE DRIVER ...
254
votes
15
answers
310k
views
Docker Compose keep container running
I want to start a service with docker-compose and keep the container running so I can get its IP-address via 'docker inspect'. However, the container always exits right after starting up.
I tried to ...
236
votes
31
answers
481k
views
Docker error: invalid reference format: repository name must be lowercase
Ran into this Docker error with one of my projects:
invalid reference format: repository name must be lowercase
What are the various causes for this generic message?
I already figured it out after ...