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
4 answers

How to mount a postgresql volume using Aws EBS in Kubernete

I've created the persistent volume (EBS 10G) and corresponding persistent volume claim first. But when I try to deploy the postgresql pods as below (yaml file) : test-postgresql.yaml Receive the errors from pod: initdb: directory…
X.J
  • 473
  • 1
  • 5
  • 9
44
votes
2 answers

Memory usage discrepancy: cgroup memory.usage_in_bytes vs. RSS inside docker container

"Kubernetes" (v1.10.2) says that my pod (which contains one container) is using about 5GB memory. Inside the container, RSS is saying more like 681MiB. Can anypony explain how to get from 681MiB to 5GB with the following data (or describe how to…
burnettk
  • 13,557
  • 4
  • 51
  • 52
44
votes
1 answer

what's the double arrow (<<: *django) mean in a docker-compose file?

I see something like celerybeat: <<: *django in https://github.com/pydanny/cookiecutter-django example docker files. What does it mean? I can't google <<: *
eugene
  • 39,839
  • 68
  • 255
  • 489
44
votes
10 answers

Keycloak Docker HTTPS required

I have initialized https://hub.docker.com/r/jboss/keycloak/ on my Digital Ocean Docker Droplet. $docker run -e KEYCLOAK_USER=admin -e -p 8080:8080 KEYCLOAK_PASSWORD={password with upcase etc.} jboss/keycloak success Everything worked well and the…
user6947621
  • 607
  • 1
  • 5
  • 8
44
votes
4 answers

When installing Rust toolchain in Docker, Bash `source` command doesn't work

I am trying to create a docker image that will setup a Linux environment for building Rust projects. Here is my Dockerfile so far: FROM ubuntu:16.04 # Update default packages RUN apt-get update # Get Ubuntu packages RUN apt-get install -y \ …
JamesFaix
  • 8,050
  • 9
  • 37
  • 73
44
votes
12 answers

connecting to Mongodb inside a docker with mongodb compass GUI

I have a mongodb database running on the default port 27017 in a docker container. Is there a way to connect to the database with the mongodb compass GUI running natively on my ubuntu OS?
samsung gather
  • 583
  • 1
  • 4
  • 8
44
votes
4 answers

PHP intl extension in Docker container

I'm trying to load the intl PHP extension in my Docker container, but it doesn't seem to work. Have already tried this https://github.com/docker-library/php/issues/57 but I still get the same error message: configure: error: in…
Marcelo Noguti
  • 830
  • 1
  • 9
  • 17
44
votes
2 answers

FUSE inside Docker

I'm trying to install and use FUSE inside a Docker container. My Dockerfile is the following: FROM golang:1.8 WORKDIR /go/src/app COPY . . RUN apt-get update && apt-get install -y fuse && rm -rf /var/lib/apt/lists/* RUN go-wrapper download RUN…
Cydonia7
  • 3,744
  • 2
  • 23
  • 32
44
votes
4 answers

Run X application in a Docker container reliably on a server connected via SSH without "--net host"

Without a Docker container, it is straightforward to run an X11 program on a remote server using the SSH X11 forwarding (ssh -X). I have tried to get the same thing working when the application runs inside a Docker container on a server. When…
rubund
  • 7,603
  • 3
  • 15
  • 24
44
votes
4 answers

"Empty continuation lines will become errors"… how should I comment my Dockerfile now?

Consider the following Dockerfile: FROM alpine:edge EXPOSE \ # web portal 8080 \ # backdoor 8081 Built like so: docker build . We observe such output: Sending build context to Docker daemon 17.1TB Step 1/2 : FROM alpine:edge --->…
Birchlabs
  • 7,437
  • 5
  • 35
  • 54
44
votes
3 answers

Why is docker images list empty?

I'm trying to see a list of images in my docker instance, but I keep getting an empty list. I run docker run busybox:latest echo hello It prints hello. I run docker images list --all it prints REPOSITORY TAG IMAGE ID …
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80
44
votes
6 answers

Configure reverse-proxy for Keycloak docker with custom base URL

How can I set the docker keycloak base url as parameter ? I have the following nginx reverse proxy configuration: server { listen 80; server_name example.com; location /keycloak { proxy_pass http://example.com:8087/; …
louis amoros
  • 2,418
  • 3
  • 19
  • 40
44
votes
2 answers

How to open/run YML compose file?

How can I open/run a YML compose file on my computer? I've installed Docker for Windows and Docker tools but couldn't figure out how.
dstr
  • 8,362
  • 12
  • 66
  • 106
44
votes
6 answers

How does one detect if one is running within a docker container within Python?

I was trying to find out if my script was running inside a docker container or not within the python script. Something like: if inside_docker(): do_stuff() else: do_some_other_stuff() to do this the only hacky way I found out how to do it…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
44
votes
2 answers

What does CREATED container mean in docker?

I am bit confused on the status of the docker container, especially with status as CREATED. I know that when the container is running state it shows as below: root@labadmin-VirtualBox:~/RAGHU/DOCKER# docker ps CONTAINER ID IMAGE …
Here_2_learn
  • 5,013
  • 15
  • 50
  • 68