Setup Docker in Ubuntu » History » Version 2
Gareth Eaton, 08/03/2023 10:14 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 | Install Docker: |
||
28 | |||
29 | |||
30 | <pre> |
||
31 | sudo apt update |
||
32 | sudo apt install -y docker-ce docker-ce-cli containerd.io |
||
33 | </pre> |
||
34 | |||
35 | |||
36 | Start and Enable Docker: |
||
37 | |||
38 | <pre> |
||
39 | sudo systemctl start docker |
||
40 | sudo systemctl enable docker |
||
41 | </pre> |
||
42 | |||
43 | |||
44 | Verify Docker Installation: |
||
45 | |||
46 | <pre> |
||
47 | sudo docker --version |
||
48 | sudo docker info |
||
49 | </pre> |
||
50 | |||
51 | Run a Test Container: |
||
52 | |||
53 | <pre> |
||
54 | sudo docker run hello-world |
||
55 | </pre> |