Setup Docker in Ubuntu » History » Version 5
Gareth Eaton, 08/03/2023 10:18 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 | 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 |
||
32 | 1 | Gareth Eaton | |
33 | 3 | Gareth Eaton | |
34 | 5 | Gareth Eaton | For arm64 architecture: |
35 | 3 | Gareth Eaton | |
36 | 5 | 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 | 3 | Gareth Eaton | |
38 | 1 | Gareth Eaton | Install Docker: |
39 | |||
40 | |||
41 | <pre> |
||
42 | sudo apt update |
||
43 | sudo apt install -y docker-ce docker-ce-cli containerd.io |
||
44 | </pre> |
||
45 | |||
46 | |||
47 | Start and Enable Docker: |
||
48 | |||
49 | <pre> |
||
50 | sudo systemctl start docker |
||
51 | sudo systemctl enable docker |
||
52 | </pre> |
||
53 | |||
54 | |||
55 | Verify Docker Installation: |
||
56 | |||
57 | <pre> |
||
58 | sudo docker --version |
||
59 | sudo docker info |
||
60 | </pre> |
||
61 | |||
62 | Run a Test Container: |
||
63 | |||
64 | <pre> |
||
65 | sudo docker run hello-world |
||
66 | </pre> |