Questions tagged [docker]

For questions about building and running Docker containers. DOCKER QUESTIONS MUST BE SPECIFICALLY RELATED TO SOFTWARE DEVELOPMENT. Suitable topics include Dockerfiles, Docker Compose, and architecture. As a rule of thumb, if your question is about something happening inside the container, it's probably on-topic here; if it's outside the container, it is probably off-topic.

The term docker usually refers to a set of open-source tools that allow developers to build and run containers individually or as a 'stack' of related containers. A container is an isolated package that contains everything, except for the kernel, needed to run a piece of software. Docker was initially written to work with Linux and has recently been implemented on MS Windows. Docker Inc. is the company behind the open-source docker toolset.

Docker builds a high-level API over execution drivers, such as OpenVZ, systemd-nspawn, libvirt-lxc, libvirt, QEMU/KVM, BSD Jails, Solaris Zones, and chroot to run processes with some degree of isolation and repeatability across environments. The default execution driver since release 0.9 is Docker's own libcontainer driver. It's mainly written in Go, and its source code can be found on Github. See Docker's official website for details.

For a docker installation on different operating systems such as Linux, Windows, or OS X, details can be found here; from this site, information about Docker under Windows, Mac or Linux distributions can be accessed. On Windows and OS-X, docker runs in a variety of VM.

Releases have three types: stable, edge and test. The latest stable version is given by the following badge (links to the corresponding release notes): docker:latest version

Note that since May 2017, docker is a product (split into CE and EE) built on top of the open-source project Moby. In November 2019, Docker Inc. sold its enterprise business and software to Mirantis. For more, see "Demystifying the Relationship Between Moby & Docker".

Where to ask

Questions on Stack Overflow must be programming-related; see the extended description in the help centre for more details. Questions about using Docker as a live development environment, mechanics of the Dockerfile system, and other questions that clearly involve application source code are generally welcome.

Questions about installing Docker or running prebuilt images are typically not programming-oriented and are not on-topic for Stack Overflow. Consider asking these questions on Super User, or a site more specific to your host operating system (Ask Ubuntu, Unix & Linux, Raspberry Pi Stack Exchange, Ask Different for macOS). Questions about using a Linux distribution package manager such as apt-get or apk are similarly inappropriate for Stack Overflow, even if they are otherwise in the context of a Dockerfile.

There are other container-management tools adjacent to Docker. In particular, is often used in combination with images produced with Docker. The tag should be used when a question is principally about native-Docker technologies, including and the build system; but omit if a question is principally about a Kubernetes YAML file or another adjacent technology and only includes a Docker image by reference.

Frequently asked questions

Where to start

  • Docker Curriculum: A comprehensive tutorial for getting started with Docker. Teaches how to use Docker and deploy dockerized apps on AWS with Elastic Beanstalk and Elastic Container Service.
  • Docker Documentation: the official documentation
  • Docker Training :heavy_dollar_sign:
  • Katacoda: Learn Docker using Interactive Browser-Based Labs
  • Learn Docker: a step-by-step tutorial and more resources (video, articles, cheat sheets) by @dwyl
  • Play With Docker: PWD is a great way to get started with Docker for beginner to advanced users. Docker runs directly in your browser.
  • Play With Moby: PWM is a web-based Moby playground which allows you to try different components of the platform in seconds. It gives you the experience of having a free Alpine Linux Virtual Machine in the cloud where you can build and run Moby projects and even create clusters to experiment.
  • Practical Introduction to Container Terminology The landscape for container technologies is more significant than just docker. Without a good handle on the terminology, It can be challenging to grasp the key differences between docker and (pick your favourites, CRI-O, rkt, lxc/lxd) or understand what the Open Container Initiative is doing to standardize container technology.
  • Docker Tutorial for Beginners (Updated 2019 version) — In this Docker tutorial, you'll learn all the basics and learn how you can containerize Node.js and Go applications. Even if you aren't familiar with these languages, it should be easy for you to follow this tutorial and use any other language.

Books

Development with Docker

API Client

CI/CD

  • Buddy:heavy_dollar_sign: - The best of Git, build & deployment tools combined into one powerful tool that supercharged our development.
  • Captain - Convert your Git workflow to Docker containers ready for Continuous Delivery by @harbur.
  • Cyclone - Powerful workflow engine and end-to-end pipeline solutions implemented with native Kubernetes resources by @caicloud.
  • Docker plugin for Jenkins - The aim of the docker plugin is to be able to use a docker host to dynamically provision a slave, run a single build, and then tear down that slave.
  • Drone - Continuous integration server built on Docker and configured using YAML files.
  • GitLab Runner - GitLab has integrated CI to test, build and deploy your code with the use of GitLab runners.
  • GOCD-Docker - Go Server and Agent in docker containers to provision.
  • Microservices Continuous Deployment - Continuous deployment of a microservices application.
  • mu - Tool to configure CI/CD of your container applications via AWS CodePipeline, CodeBuild and ECS @Stelligent
  • Screwdriver :heavy_dollar_sign: - Yahoo's OpenSource build platform designed for Continous Delivery.
  • Skipper - Easily dockerize your Git repository by @Stratoscale
  • SwarmCI - Create a distributed, isolated task pipeline in your Docker Swarm.
  • Watchtower - Automatically update running Docker containers by [@CenturyLinkLabs][centurylinklabs]

More resources

Related tags

133164 questions
42
votes
6 answers

Find out which network interface belongs to docker container

Docker creates these virtual ethernet interfaces veth[UNIQUE ID] listed in ifconfig. How can I find out which interface belongs to a specific docker container? I want to listen to the tcp traffic.
Mahoni
  • 7,088
  • 17
  • 58
  • 115
42
votes
2 answers

How to install pdo driver in php docker image?

I am using as a base the php docker container with the tag: php:5.6-apache I linked it with a basic mysql:5.6 image which I can reach at the host mysql. I created a DB, and filled a table with basic values. Yet trying to access my app, I get: Fatal…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
42
votes
2 answers

.dockerignore mentioned files are not ignored

I'm having in Dockerfile: ENV DATARATOR_HOME /usr/local/share/datarator RUN mkdir -p $DATARATOR_HOME COPY . $DATARATOR_HOME and .dockerignore file: /Gemfile.lock /coverage /spec *.bundle *.so *.o *.a mkmf.log *.swp /.* /tmp /log However, once…
Peter Butkovic
  • 11,143
  • 10
  • 57
  • 81
42
votes
1 answer

What is different of Config and ContainerConfig of docker inspect?

I use docker inspect to get the image information. I find there are Config and ContainerConfig in the output, and most value are the same, except the CMD. In practice, the Config take effect. For I must add cmd in the run command. $ docker run -it…
firelyu
  • 2,102
  • 5
  • 25
  • 29
42
votes
1 answer

Erlang/Elixir on Docker and Hot Code Swap

One of the features of Erlang (and, by definition, Elixir) is that you can do hot code swap. However, this seems to be at odd with Docker, where you would need to stop your instances and restart new ones with new images holding the new code. This…
Marc Trudel
  • 1,244
  • 1
  • 12
  • 19
42
votes
5 answers

Docker 1.10 access a container by its hostname from a host machine

I have the Docker version 1.10 with embedded DNS service. I have created two service containers in my docker-compose file. They are reachable each other by hostname and by IP, but when I would like reach one of them from the host machine, it…
Adam Bernau
  • 729
  • 2
  • 6
  • 12
42
votes
3 answers

How can I let the gitlab-ci-runner DinD image cache intermediate images?

I have a Dockerfile that starts with installing the texlive-full package, which is huge and takes a long time. If I docker build it locally, the intermedate image created after installation is cached, and subsequent builds are fast. However, if I…
Roel Harbers
  • 1,014
  • 1
  • 9
  • 18
42
votes
5 answers

Accessing Docker container files from Windows

How can I access Docker containers Folder and files from Windows file explorer?
Nafis Abdullah Khan
  • 2,062
  • 3
  • 22
  • 39
42
votes
5 answers

What is the difference between Docker Host and Container

I started learning about Docker. But I keep getting confused often, even though I read it in multiple places. Docker Host and Docker Container. Docker Engine is the base Engine that handles the containers. Docker Containers sit on top of Docker…
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
42
votes
1 answer

Command line arguments to Docker CMD

I want to pass in a parameter into a docker CMD. For example, if the contents of Dockerfile are FROM ubuntu:15.04 CMD ["/bin/bash", "-c", "cat", "$1"] Then I want to run as follows: docker build -t cat_a_file . docker run -v `pwd`:/data cat_a_file…
user14717
  • 4,757
  • 2
  • 44
  • 68
42
votes
2 answers

How to use Docker's COPY/ADD instructions to copy a single file to an image

I am trying to copy a single file from the root of the build context into a newly created directory in a docker image. The Dockerfile that I am using is as follows: FROM debian:latest RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY test.txt…
Andrew Butler
  • 687
  • 1
  • 6
  • 12
42
votes
3 answers

installing a GCC compiler onto a Docker Container

I am trying to install mono package onto a Docker container, but mono requires git , autoconf, libtool, automake, build-essential , mono-devel, gettext packages. the problem I am having is that libtool requires libc-dev, and libc-dev requires gcc…
sophie-germain
  • 911
  • 4
  • 10
  • 22
42
votes
6 answers

run apps using audio in a docker container

This question is inspired by Can you run GUI apps in a docker container?. The basic idea is to run apps with audio and ui (vlc, firefox, skype, ...) I was searching for docker containers using pulseaudio but all containers I found where using…
A. Binzxxxxxx
  • 2,812
  • 1
  • 21
  • 33
42
votes
4 answers

nginx proxy_pass to a linked docker container

I have two docker containers with nginx. container1 is linked to container2. Docker then adds an entry to /etc/hosts which I entered into the nginx configuration like so: server { location ~ ^/some_url/(.*)$ { proxy_pass…
Tim
  • 1,315
  • 1
  • 14
  • 35
42
votes
10 answers

How to connect PyCharm to a python interpreter located inside a Docker container?

I'm starting with Docker, but I don't know how to configure PyCharm to use a python interpreter located in a container. It was easy to setup with Vagrant, but there's apparently no official way to do it with Docker yet. Should I prepare special…
trikoder_beta
  • 2,800
  • 4
  • 15
  • 17
1 2 3
99
100