summaryrefslogtreecommitdiff
path: root/doc/note/docker/Docker-Daemon-Install.txt
blob: 1bfa6bb194f8be74eddb4504e72363827603b373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

How to install a docker daemon eg in a VM or so
===============================================

Setup a VM (eg debian bullseye)

Add auth proxy in "/etc/environment"

Make sure "apt update" works.

Install docker as described on "https://docs.docker.com/engine/install/debian/"

  sudo apt update
  sudo apt-get install -y --no-install-recommends ca-certificates curl gnupg lsb-release

  # I had to download that gpg on my host and then pasting it into the vm
  # to use it there
  curl -sSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

  echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

  sudo apt update
  sudo apt install -y --no-install-recommends docker-ce docker-ce-cli containerd.io

Edit "/lib/systemd/system/docker.service" and add environ config in "service"
section (HINT: "/etc/environment" does not work)

  [service]
  ...
  Environment="HTTP_PROXY=http://10.0.2.2:3128"
  Environment="http_proxy=http://10.0.2.2:3128"
  Environment="HTTPS_PROXY=http://10.0.2.2:3128"
  Environment="https_proxy=http://10.0.2.2:3128"
  Environment="NO_PROXY=127.0.0.1,10.0.2.2,*.post.ch"
  Environment="no_proxy=127.0.0.1,10.0.2.2,*.post.ch"


Edit (or create) "/etc/docker/daemon.json" with contents as below.
HINT: Maybe 'insecure' not needed, ToBeTested.

    {
      "registry-mirrors": [
        "https://docker.tools.post.ch"
      ],
      "insecure-registries" : [
        "index.docker.io",
        "docker.tools.post.ch"
      ]
    }