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
43
votes
3 answers

Executing SQL scripts on docker container

I have a docker container running mysql and I want to push a .sql file to the container and then have mysql execute the commands in it. The first step is fairly straightforward: docker cp ./dummy.sql :/ From there I am trying to run…
Akron
  • 1,413
  • 2
  • 13
  • 28
43
votes
1 answer

docker-compose yml running a script after up

I want to run a script, right after running `docker-compose up -d` Here is my snippet of docker-compose.yml . The other settings are mysql server, redis...etc....but they are not causing any problems web: image: nginx container_name:…
Confidence
  • 2,283
  • 3
  • 33
  • 57
43
votes
1 answer

Understanding docker -v command

I was just going through this tutorial on Youtube, trying to understand the use of the -v command. Why is the author using the -v command? He uses the command, like so: docker run -v /var/lib/mysql --name=my_datastore -d busybox echo "my…
Tenali_raman
  • 2,000
  • 3
  • 18
  • 28
43
votes
9 answers

docker-compose up leads to "client and server don't have same version (client : 1.14, server: 1.12)" error but client and server have the same version

docker version prints: Client version: 1.0.1 Client API version: 1.12 Go version (client): go1.2.1 Git commit (client): 990021a Server version: 1.0.1 Server API version: 1.12 Go version (server): go1.2.1 Git commit (server): 990021a docker-compose…
Donovan
  • 816
  • 1
  • 10
  • 16
43
votes
9 answers

Docker Ubuntu Behind Proxy

Looking at docs there is no instruction on how to run it behind a proxy. https://docs.docker.com/installation/ubuntulinux/ Reading on forums, the instruction is to update /etc/default/docker to export the proxy setup. export…
sesteva
  • 1,716
  • 2
  • 16
  • 17
43
votes
11 answers

How can I set a static IP address in a Docker container?

I'm perfectly happy with the IP range that docker is giving me by default 176.17.x.x, so I don't need to create a new bridge, I just want to give my containers a static address within that range so I can point client browsers to it directly. I tried…
dlanced
  • 1,050
  • 2
  • 11
  • 17
42
votes
4 answers

Error in anyjson setup command: use_2to3 is invalid

#25 3.990 × python setup.py egg_info did not run successfully. #25 3.990 │ exit code: 1 #25 3.990 ╰─> [1 lines of output] #25 3.990 error in anyjson setup command: use_2to3 is invalid. #25 3.990 [end of output] This is a common…
Richard McCormick
  • 639
  • 1
  • 6
  • 12
42
votes
6 answers

DOCKER container with postgres, WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted

I have a DOCKER container built from a few different images using a .yml, Dockerfile(s), etc. Everything builds and runs fine so far, except for this one issue that I am seeing mentioned in the title: index-db_1 | 2021-02-22 23:18:33.388 UTC [31]…
SScotti
  • 2,158
  • 4
  • 23
  • 41
42
votes
3 answers

failed to start daemon: Error initializing network controller: Error creating default "bridge" network

I'm using Fedora release 33 (Thirty Three) Docker version is Docker version 20.10.0, build 7287ab3 First I ran docker system prune and since then docker daemon failed to start. I ran systemctl start docker command and got Job for docker.service…
Alon Barad
  • 1,491
  • 1
  • 13
  • 26
42
votes
7 answers

VScode unable to save files inside my WSL2 home folder

I'm trying to make WSL2 work for my web projects development and this is driving me crazy! Basically, i have two options. 1. Save my project files into c drive and access those with WSL (which makes the responses extremelly slow) 2. save my project…
42
votes
7 answers

Why is Docker filling up /var/lib/docker/overlay2?

Even though I have successfully (?) removed all Docker images and containers, the folder /var/lib/docker/overlay2 still is vast (152 GB). Why? How do I reduce the used disk size? I have tried to rename the folder (in preparation for a possible…
Floffy75
  • 609
  • 1
  • 5
  • 7
42
votes
5 answers

How to configure nginx X-Forwarded-Port to be the originally request port

I am using nginx in a standard reverse proxy scenario, to pass all requests to /auth to another host, however I'm trying to use non-standard ports. My end goal is to have the X-Forwarded-Port header set to the port that the request comes in on. Here…
42
votes
2 answers

Docker app server ip address 127.0.0.1 difference of 0.0.0.0 ip

He everyone. I'm working with docker and trying to dockerize a simple django application that does an external http connect to a web page (real website) so when I set in the Docker file the address of my django server that should work in the…
Velidan
  • 5,526
  • 10
  • 48
  • 86
42
votes
10 answers

Docker: PhpMyAdmin has an upload limit of 2048KiB

i have a docker-compose.yml that looks like this: webserver: build: ./_docker/php ports: - 80:80 links: - mysql volumes_from: - app mysql: image: mysql:5.7 environment: MYSQL_DATABASE: "${DB_NAME}" MYSQL_USER:…
lvollmer
  • 1,418
  • 2
  • 13
  • 32
42
votes
9 answers

Docker in MacOs is very slow

I have this docker-compose.yml: version: "3.1" services: memcached: image: memcached:alpine container_name: universal-memcached2 redis: image: redis:alpine container_name: universal-redis2 mariadb: image:…
trafficker
  • 601
  • 1
  • 11
  • 20