Cannot download Docker images behind a proxy

Here is a link to the official Docker documentation for proxy HTTP: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy A quick outline: First, create a systemd drop-in directory for the Docker service: mkdir /etc/systemd/system/docker.service.d Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY and HTTPS_PROXY environment variables: [Service] Environment=”HTTP_PROXY=http://proxy.example.com:80/” Environment=”HTTPS_PROXY=http://proxy.example.com:80/” If you have internal Docker registries that you need to … Read more

Why docker container exits immediately

This did the trick for me: docker run -dit ubuntu After it, I checked for the processes running using: docker ps -a For attaching again the container docker attach CONTAINER_NAME TIP: For exiting without stopping the container type: ^P^Q

Permission denied on accessing host directory in Docker

See this Project Atomic blog post about Volumes and SELinux for the full story. Specifically: This got easier recently since Docker finally merged a patch which will be showing up in docker-1.7 (We have been carrying the patch in docker-1.6 on RHEL, CentOS, and Fedora). This patch adds support for “z” and “Z” as options … Read more

How to start a stopped Docker container with a different command?

Find your stopped container id docker ps -a Commit the stopped container: This command saves modified container state into a new image user/test_image docker commit $CONTAINER_ID user/test_image Start/run with a different entry point: docker run -ti –entrypoint=sh user/test_image Entrypoint argument description: https://docs.docker.com/engine/reference/run/#/entrypoint-default-command-to-execute-at-runtime Note: Steps above just start a stopped container with the same filesystem state. … Read more

Using the RUN instruction in a Dockerfile with ‘source’ does not work

Original Answer FROM ubuntu:14.04 RUN rm /bin/sh && ln -s /bin/bash /bin/sh This should work for every Ubuntu docker base image. I generally add this line for every Dockerfile I write. Edit by a concerned bystander If you want to get the effect of “use bash instead of sh throughout this entire Dockerfile”, without altering … Read more

Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

If using jenkins The user jenkins needs to be added to the group docker: sudo usermod -a -G docker jenkins Then restart Jenkins. Otherwise If you arrive to this question of stack overflow because you receive this message from docker, but you don’t use jenkins, most probably the error is the same: your unprivileged user … Read more

How can I inspect the file system of a failed `docker build`?

Everytime docker successfully executes a RUN command from a Dockerfile, a new layer in the image filesystem is committed. Conveniently you can use those layers ids as images to start a new container. Take the following Dockerfile: FROM busybox RUN echo ‘foo’ > /tmp/foo.txt RUN echo ‘bar’ >> /tmp/foo.txt and build it: $ docker build … Read more

What does Docker add to lxc-tools (the userspace LXC tools)?

From the Docker FAQ: Docker is not a replacement for lxc. “lxc” refers to capabilities of the linux kernel (specifically namespaces and control groups) which allow sandboxing processes from one another, and controlling their resource allocations. On top of this low-level foundation of kernel features, Docker offers a high-level tool with several powerful functionalities: Portable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)