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
44
votes
1 answer

RubyMine doesn't see gems from bundle in Docker on Mac OS

I'm using a Docker image with some specified environmental variables, such as GEM_HOME and BUNDLE_PATH. RubyMine connects to the remote Docker SDK just fine, but I can't see gems added by bundler, even though bundler itself is there. My profiler…
Viktor
  • 4,218
  • 4
  • 32
  • 63
44
votes
2 answers

How to configure autoscaling on docker swarm?

I would like to know how to configure this tool to start with a minimum number of nodes and grow to a maximum number of nodes when it is required. Should I use another tool or can docker swarm solve this for me?
Celso Agra
  • 1,389
  • 2
  • 15
  • 37
44
votes
4 answers

Where is the Postgres username/password being created in this Dockerfile?

I was following this tutorial: https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/ I have everything up and running, but there are a few things going on that I'm not able to follow or understand. In the main…
david
  • 6,303
  • 16
  • 54
  • 91
44
votes
6 answers

no internet inside docker-compose service

I cannot reach external network from docker-compose containers. Consider the following docker-compose file: version: '2' services: nginx: image: nginx Using the simple docker run -it nginx bash I manage to reach external IPs or Internet…
orshachar
  • 4,837
  • 14
  • 45
  • 68
44
votes
3 answers

AWS Docker deployment

I have a custom docker image uploaded to ECS. I opened up the permissions to try and get through this issue (I will lock it down again once I can get this to work). I am attempting to deploy the docker image to elastic beanstalk. I have a docker…
44
votes
4 answers

installing `lightdm` in Dockerfile raises interactive keyboard layout menu

I have the following Dockerfile: # Pull from CentOS RPM Build Image FROM ubuntu # Update the image RUN apt-get update -y RUN apt-get install lightdm -y The problem I have is when I'm building this container with docker build -t dumbcontainer ., at…
lurscher
  • 25,930
  • 29
  • 122
  • 185
44
votes
7 answers

Deleting all docker images and containers

I am very new to Docker and enjoying it very much. I want to delete all images and containers from local as well as from docker hub. Is there any single command to do that?
Mahammad Adil Azeem
  • 9,112
  • 13
  • 57
  • 84
44
votes
4 answers

docker-machine: Can't access container's web server from host

I just installed Docker with Docker-Toolbox on my Mac using homebrew: install docker with homebrew After creating and configuring a Container with Rails, Postgres and starting docker-compose up everything looks fine but i can't access the webserver…
StandardNerd
  • 4,093
  • 9
  • 46
  • 77
44
votes
7 answers

Redis Docker connection refused

I just built the redis docker instance $ docker pull redis After which I ran it like this. $ docker run --name=redis --detach=true --publish=6379:6379 redis I get the following $ docker ps key redis "/sbin/entrypoint.sh" 22 minutes…
Ikenna
  • 989
  • 4
  • 12
  • 24
44
votes
5 answers

Getting console output from a Docker container

I build an image with Python installed and a Python application too. My Python application is a Hello, World! application, just printing "Hello, World!" on the screen. Dockerfile: FROM python:2-onbuild CMD ["python", "./helloworld.py"] In the…
p.magalhaes
  • 7,595
  • 10
  • 53
  • 108
44
votes
7 answers

Where should I set the '--insecure-registry' flag on Mac OS?

I am using OS X 10.10. When trying to communicate with our team's private docker registry, it keeps giving me errors like this: Error: Invalid registry endpoint https://registry.xxx.xxx/v1/: Get https://registry.af-sys.com/v1/_ping: dial tcp…
mainframer
  • 20,411
  • 12
  • 49
  • 68
44
votes
2 answers

Docker creates files as root in mounted volume

I'm using Docker (1.3.1) to build RPMs inside a container: docker run -v /home/matt/build:/build build-rpm /build/build-pkg.sh This works fine (my user is in the docker group, so I don't need to sudo) and drops a completed .rpm file in the current…
Matt R
  • 9,892
  • 10
  • 50
  • 83
44
votes
4 answers

docker-compose: using multiple Dockerfiles for multiple services

I'm using docker-compose and I'd like to use different Dockerfiles for different services' build steps. The docs seem to suggest to place different Dockerfiles in different directories, but I'd like them all to be in the same one (and perhaps…
aralar
  • 3,022
  • 7
  • 29
  • 44
44
votes
4 answers

Docker Error - "jq: error: Cannot iterate over null"

So I'm trying to deploy a dockerfile on Elastic Beanstalk, but I can't get past this error - "jq: error: Cannot iterate over null". Successfully built [myContainerId] Successfully built aws_beanstalk/staging-app [2015-01-29T10:35:59.494Z] INFO …
YYZ
  • 749
  • 4
  • 8
  • 18
44
votes
7 answers

Docker Hub Automated Build - Tagging

When specifying an Automated Build on Docker Hub, I can set some settings (Type ('Branch' or 'Tag'), Name, Dockerfile Location and Docker Tag Name). But unfortunately I didn't find any documentation for those. I assume, that when I choose Type…
MirkoMachine
  • 501
  • 1
  • 5
  • 6