Project

General

Profile

Setup Docker in Ubuntu » History » Version 4

Gareth Eaton, 08/03/2023 10:17 PM

1 1 Gareth Eaton
h1. Setup Docker in Ubuntu
2
3
Set up an Ununtu server - we will use 22.10
4
5
6
Update Package Index:
7
8
<pre>
9
sudo apt update && apt upgrade
10
</pre>
11
12
Install Prerequisites:
13
14
<pre>
15
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
16
</pre>
17
18
Add Docker Repository:
19
20 2 Gareth Eaton
Your might have to install curl - apt install curl
21 1 Gareth Eaton
<pre>
22
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
23
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
24
</pre>
25
26
27 3 Gareth Eaton
Add the Docker repository:
28
29
For x86_64/amd64 architecture:
30
31 4 Gareth Eaton
32 3 Gareth Eaton
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
33 1 Gareth Eaton
For arm64 architecture:
34 3 Gareth Eaton
35 4 Gareth Eaton
36 3 Gareth Eaton
echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
37
38
39
40 1 Gareth Eaton
Install Docker:
41
42
43
<pre>
44
sudo apt update
45
sudo apt install -y docker-ce docker-ce-cli containerd.io
46
</pre>
47
48
49
Start and Enable Docker:
50
51
<pre>
52
sudo systemctl start docker
53
sudo systemctl enable docker
54
</pre>
55
56
57
Verify Docker Installation:
58
59
<pre>
60
sudo docker --version
61
sudo docker info
62
</pre>
63
64
Run a Test Container:
65
66
<pre>
67
sudo docker run hello-world
68
</pre>