5
5
Docker and Podman are very similar tools, that allow you to manage and run
6
6
container images. Unlike Docker, Podman runs without a daemon, allows you to run
7
7
containers without root permissions, but does not let you build a container from
8
- source. The command line syntax is mostly identical for Docker and Podman.
8
+ the source. The command line syntax is mostly identical for Docker and Podman.
9
9
Choose whatever is available on your system.
10
10
11
11
## SYCL Containers overview
@@ -14,27 +14,27 @@ The following containers are publicly available for DPC++ compiler development:
14
14
15
15
- ` ghcr.io/intel/llvm/ubuntu2004_base ` : contains basic environment setup for
16
16
building DPC++ compiler from source.
17
- - ` ghcr.io/intel/llvm/ubuntu2004_intel_drivers ` : contains everything from base
18
- container + pre-installed Intel drivers. This image provides two main tags:
19
- ` latest ` , that uses latest available drivers, and ` stable ` , that uses
20
- recommended drivers.
21
- - ` ghcr.io/intel/llvm/ubuntu2004_nightly ` : contains latest successfully built
22
- nightly build of DPC++ compiler, as well as pre-installed Intel drivers.
17
+ - ` ghcr.io/intel/llvm/ubuntu2004_intel_drivers ` : contains everything from the
18
+ base container + pre-installed Intel drivers.
19
+ - ` ghcr.io/intel/llvm/sycl_ubuntu2004_nightly ` : contains the latest successfully
20
+ built nightly build of DPC++ compiler. The image comes in two flavors:
21
+ with pre-installed Intel drivers (` latest ` ) and without them (` no-drivers ` ).
23
22
24
23
## Building a Docker Container from scratch
25
24
26
- Docker containers can be build with the following command:
25
+ Docker containers can be built with the following command:
27
26
28
27
```
29
28
docker build -f path/to/devops/containers/file.Dockerfile path/to/devops/
30
29
```
31
30
32
- The ` ubuntu2004_preinstalled.Dockerfile ` script expects ` llvm_sycl.tar.gz ` file
31
+ The ` ubuntu2004_preinstalled.Dockerfile ` script expects ` llvm_sycl.tar.xz ` file
33
32
to be present in ` devops/ ` directory.
34
33
35
- Containers other than base provide several configurable arguments, most commonly
36
- used are` base_image ` and ` base_tag ` , that specify base Docker image and its tag.
37
- You can set additional arguments with ` --build-arg ARG=value ` argument.
34
+ Containers other than base provide several configurable arguments, the most
35
+ commonly used are ` base_image ` and ` base_tag ` , which specify the base Docker
36
+ image and its tag. You can set additional arguments with ` --build-arg ARG=value `
37
+ argument.
38
38
39
39
## Running Docker container interactively
40
40
@@ -43,7 +43,7 @@ you to run containers interactively, so that you can use it as you would use a
43
43
terminal or SSH session. The following command allows you to do that:
44
44
45
45
```
46
- docker run --name <friendly_name> -it --entrypoint /bin/bash <image_name>[:<tag>]
46
+ docker run --name <friendly_name> -it <image_name>[:<tag>] /bin/bash
47
47
```
48
48
49
49
This command will download an image, if it does not exist locally. If you've
@@ -53,12 +53,46 @@ downloaded an image previously, and you want to update it, use
53
53
## Passthrough an Intel GPU to container
54
54
55
55
Add ` --device=/dev/dri ` argument to ` run ` command to passthrough you Intel GPU.
56
+ Make sure you're a member of ` video ` group to be able to access GPU.
56
57
57
58
## Passthrough a directory to container
58
59
59
60
Use ` -v path/on/host:path/in/container ` argument for ` run ` command to
60
61
passthrough a host directory or a file.
61
62
63
+ ## Persisting data with volumes
64
+
65
+ Docker container images are read-only. When container is destroyed, all its data
66
+ is lost. To persist data when working with containers (i.e. when upgrading
67
+ container version) one can use Docker volumes.
68
+
69
+ Creating a volume:
70
+
71
+ ```
72
+ docker volume create <volume name>
73
+ ```
74
+
75
+ Listing all volumes:
76
+
77
+ ```
78
+ docker volume list
79
+ ```
80
+
81
+ Mounting volume to the container:
82
+
83
+ ```
84
+ docker run <options> -v <volume_name>:/path/inside/container <image_name> bash
85
+ ```
86
+
87
+ Deleting a volume:
88
+
89
+ ```
90
+ docker volume rm <image_name>
91
+ ```
92
+
93
+ See [ official documentation] ( https://docs.docker.com/storage/volumes/ ) for more
94
+ info.
95
+
62
96
## Managing downloaded Docker image
63
97
64
98
List local images:
@@ -70,3 +104,47 @@ Remove local image:
70
104
```
71
105
docker image rm <image_name_or_id>
72
106
```
107
+
108
+ ## Change location of the images on the system
109
+
110
+ By default Docker stores images in ` /var/lib/docker ` , but that can be changed.
111
+
112
+ Create a new file called ` /etc/docker/daemon.json ` and put the following
113
+ content:
114
+
115
+ ```
116
+ {
117
+ "data-root": "/path/to/data/root",
118
+ "exec-root": "/path/to/exec/root"
119
+ }
120
+ ```
121
+
122
+ ## Running Docker without sudo
123
+
124
+ Add your local user to ` docker ` group to be able to run docker commands without
125
+ sudo.
126
+
127
+ ## Changing Docker user
128
+
129
+ By default all processes inside Docker run as root. Some LLVM or Clang tests
130
+ expect your user to be anything but root. You can change the user by specifying
131
+ ` -u <username or uid> ` option. All Docker containers come with user ` sycl `
132
+ created.
133
+
134
+ ## Managing disk usage
135
+
136
+ See how much space is taken by docker:
137
+
138
+ ```
139
+ docker system df
140
+ ```
141
+
142
+ Cleaning unused data:
143
+
144
+ ```
145
+ docker system prune
146
+ ```
147
+
148
+ See [ official documentation] ( https://docs.docker.com/engine/reference/commandline/system_prune/ )
149
+ for more info.
150
+
0 commit comments