Skip to content

Commit 7fb2c5b

Browse files
author
Colin Chartier
committed
Update docker installation instructions
1 parent b49289d commit 7fb2c5b

File tree

8 files changed

+111
-79
lines changed

8 files changed

+111
-79
lines changed

docs/advanced-workflows/docker-login.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ FROM vm/ubuntu:18.04
3636
3737
# install the latest version of Docker, as in the official Docker installation tutorial.
3838
RUN apt-get update && \
39-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \
40-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
41-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
39+
apt-get install ca-certificates curl gnupg lsb-release && \
40+
sudo mkdir -p /etc/apt/keyrings && \
41+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
42+
echo \
43+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
44+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
4245
apt-get update && \
43-
apt install docker-ce
46+
apt-get install docker-ce docker-ce-cli containerd.io
4447
4548
SECRET ENV DOCKER_LOGIN
4649
RUN echo "$DOCKER_LOGIN" | docker login --username (INSERT USERNAME) --password-stdin

docs/advanced-workflows/duplicate-vm.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ Consider the following Layerfile:
1010
FROM vm/ubuntu:18.04
1111
1212
# install the latest version of Docker, as in the official Docker installation tutorial.
13-
RUN apt-get update && \\
14-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \\
15-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \\
16-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \\
17-
apt-get update && \\
18-
apt install docker-ce python3 python3-pip awscli
13+
RUN apt-get update && \
14+
apt-get install ca-certificates curl gnupg lsb-release && \
15+
sudo mkdir -p /etc/apt/keyrings && \
16+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
17+
echo \
18+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
19+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
20+
apt-get update && \
21+
apt-get install docker-ce docker-ce-cli containerd.io python3 python3-pip awscli
1922
2023
# install docker compose (easily starts required docker containers)
2124
RUN curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" \

docs/advanced-workflows/routing.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ FROM vm/ubuntu:18.04
7878
7979
# install the latest version of Docker, as in the official Docker installation tutorial.
8080
RUN apt-get update && \
81-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \
82-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
83-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
81+
apt-get install ca-certificates curl gnupg lsb-release && \
82+
sudo mkdir -p /etc/apt/keyrings && \
83+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
84+
echo \
85+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
86+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
8487
apt-get update && \
85-
apt install docker-ce
88+
apt-get install docker-ce docker-ce-cli containerd.io
8689
8790
COPY / .
8891
RUN REPEATABLE docker build -t backend && docker run -d -p 80:80 backend
@@ -96,13 +99,14 @@ EXPOSE WEBSITE localhost:80 /api
9699
97100
# install the latest version of Docker, as in the official Docker installation tutorial.
98101
RUN apt-get update && \
99-
apt-get install apt-transport-https ca-certificates curl
100-
software-properties-common && \
101-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
102-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu
103-
bionic stable" && \
104-
apt-get update && \
105-
apt install docker-ce
102+
apt-get install ca-certificates curl gnupg lsb-release && \
103+
sudo mkdir -p /etc/apt/keyrings && \
104+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
105+
echo \
106+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
107+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
108+
apt-get update && \
109+
apt-get install docker-ce docker-ce-cli containerd.io
106110
107111
RUN curl -Lo /usr/local/bin/fast-git-download
108112
https://gist.githubusercontent.com/ColinChartier/6bff7cf77adf7d2a8d7d699a5deed707/raw/0b89b3037548ce7e4fb24bea96628014da1bbf05/download

docs/examples/docker-compose.mdx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,16 @@ FROM vm/ubuntu:18.04
230230

231231
MEMORY 2G
232232

233-
# Install docker
234-
RUN apt-get install curl apt-transport-https ca-certificates software-properties-common
235-
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
236-
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
237-
RUN apt update
238-
RUN apt-cache policy docker-ce
239-
RUN apt install docker-ce
233+
# install the latest version of Docker, as in the official Docker installation tutorial.
234+
RUN apt-get update && \
235+
apt-get install ca-certificates curl gnupg lsb-release && \
236+
sudo mkdir -p /etc/apt/keyrings && \
237+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
238+
echo \
239+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
240+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
241+
apt-get update && \
242+
apt-get install docker-ce docker-ce-cli containerd.io
240243

241244
# Install docker compose
242245
RUN curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
@@ -294,17 +297,18 @@ least 2GB of memory are available.
294297
295298
### 3. Install Docker
296299
297-
`RUN apt-get install curl apt-transport-https ca-certificates software-properties-common`
298-
299-
`RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
300-
301-
`RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"`
302-
303-
`RUN apt update`
304-
305-
`RUN apt-cache policy docker-ce`
306-
307-
`RUN apt install docker-ce`
300+
```Layerfile
301+
# install the latest version of Docker, as in the official Docker installation tutorial.
302+
RUN apt-get update && \
303+
apt-get install ca-certificates curl gnupg lsb-release && \
304+
sudo mkdir -p /etc/apt/keyrings && \
305+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
306+
echo \
307+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
308+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
309+
apt-get update && \
310+
apt-get install docker-ce docker-ce-cli containerd.io
311+
```
308312
309313
The [instruction](../layerfile-reference/run) will run the given script, and
310314
fails the Layerfile if the script fails. In this case, we're using the `RUN`

docs/examples/docker.mdx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ instructions do.
107107
```docker Layerfile
108108
FROM vm/ubuntu:18.04
109109
110-
RUN apt-get install curl apt-transport-https ca-certificates software-properties-common
111-
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
112-
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
113-
RUN apt update
114-
RUN apt-cache policy docker-ce
115-
RUN apt install docker-ce
110+
# install the latest version of Docker, as in the official Docker installation tutorial.
111+
RUN apt-get update && \
112+
apt-get install ca-certificates curl gnupg lsb-release && \
113+
sudo mkdir -p /etc/apt/keyrings && \
114+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
115+
echo \
116+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
117+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
118+
apt-get update && \
119+
apt-get install docker-ce docker-ce-cli containerd.io
116120
117121
COPY . .
118122
@@ -142,17 +146,18 @@ machine from the ubuntu 18.04 image.
142146

143147
### 2. Install Docker
144148

145-
`RUN apt-get install curl apt-transport-https ca-certificates software-properties-common`
146-
147-
`RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
148-
149-
`RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"`
150-
151-
`RUN apt update`
152-
153-
`RUN apt-cache policy docker-ce`
154-
155-
`RUN apt install docker-ce`
149+
```Layerfile
150+
# install the latest version of Docker, as in the official Docker installation tutorial.
151+
RUN apt-get update && \
152+
apt-get install ca-certificates curl gnupg lsb-release && \
153+
sudo mkdir -p /etc/apt/keyrings && \
154+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
155+
echo \
156+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
157+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
158+
apt-get update && \
159+
apt-get install docker-ce docker-ce-cli containerd.io
160+
```
156161

157162
The `RUN` [instruction](../layerfile-reference/run) will run the given script,
158163
and fails the Layerfile if the script fails. In this case, we're using the `RUN`

docs/examples/kubernetes.mdx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ title: "Kubernetes Example"
55
```docker Layerfile
66
FROM vm/ubuntu:18.04
77
8-
# install docker-ce (from tutorial for ubuntu)
9-
RUN apt-get update && \\
10-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \\
11-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \\
12-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \\
13-
apt-get update && \\
14-
apt install docker-ce
8+
# install the latest version of Docker, as in the official Docker installation tutorial.
9+
RUN apt-get update && \
10+
apt-get install ca-certificates curl gnupg lsb-release && \
11+
sudo mkdir -p /etc/apt/keyrings && \
12+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
13+
echo \
14+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
15+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
16+
apt-get update && \
17+
apt-get install docker-ce docker-ce-cli containerd.io dnsmasq
1518
1619
# install & start k3s
1720
RUN curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.2+k3s1 sh -s - --docker

docs/introduction.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,16 @@ Livechat Example. This Layerfile for our Livechat example is shown below:
138138
```docker Layerfile
139139
FROM vm/ubuntu:18.04
140140
141-
# Install docker
141+
# install the latest version of Docker, as in the official Docker installation tutorial.
142142
RUN apt-get update && \
143-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \
144-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
145-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
146-
apt-get update && \
147-
apt install docker-ce
143+
apt-get install ca-certificates curl gnupg lsb-release && \
144+
sudo mkdir -p /etc/apt/keyrings && \
145+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
146+
echo \
147+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
148+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
149+
apt-get update && \
150+
apt-get install docker-ce docker-ce-cli containerd.io
148151
149152
# Install docker-compose
150153
RUN curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \

docs/tuning-performance/run-repeatable.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ build speed.
4747
```docker Layerfile
4848
FROM vm/ubuntu:18.04
4949
50+
# install the latest version of Docker, as in the official Docker installation tutorial.
5051
RUN apt-get update && \
51-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \
52-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
53-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
52+
apt-get install ca-certificates curl gnupg lsb-release && \
53+
sudo mkdir -p /etc/apt/keyrings && \
54+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
55+
echo \
56+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
57+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
5458
apt-get update && \
55-
apt install docker-ce
59+
apt-get install docker-ce docker-ce-cli containerd.io
5660
5761
RUN curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
5862
chmod +x /usr/local/bin/docker-compose
@@ -76,12 +80,15 @@ after the previous invocation:
7680
FROM vm/ubuntu:18.04
7781
7882
# install the latest version of Docker, as in the official Docker installation tutorial.
79-
RUN apt-get update && \\
80-
apt-get install apt-transport-https ca-certificates curl software-properties-common && \\
81-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \\
82-
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \\
83-
apt-get update && \\
84-
apt install docker-ce
83+
RUN apt-get update && \
84+
apt-get install ca-certificates curl gnupg lsb-release && \
85+
sudo mkdir -p /etc/apt/keyrings && \
86+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
87+
echo \
88+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\
89+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
90+
apt-get update && \
91+
apt-get install docker-ce docker-ce-cli containerd.io
8592
8693
# install & start k3s
8794
RUN curl -sfL https://get.k3s.io | sh -s - --docker

0 commit comments

Comments
 (0)