You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 02_virtualization_and_containers/virtualmachines_containers_exercise.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,12 +293,12 @@ This exercise consists of the following main steps:
293
293
1. Create a fork of the GitLab repository ["Exercise Containers"](https://gitlab-sim.informatik.uni-stuttgart.de/simulation-software-engineering-wite2526/exercise-containers).
294
294
2. Setting up the `Dockerfile`
295
295
- Base your image on Ubuntu 24.04
296
-
- Create a file called `testfile` that contains `USERNAME`. This file should be copied to a directory called `/testfiles` inside the container.
296
+
- Install `fastfetch` or `neofetch` inside the container
297
+
- Create a file called `testfile` that contains `USERNAME`. Using a `COPY`, copy this file to a directory called `/testfiles` inside the container.
297
298
- Set the environment variable `ENV_TEST_VARIABLE` inside the container.
298
299
- Define a default run commandfor the container.
299
-
- Install `fastfetch` or `neofetch` inside the container
300
300
- Test the new container
301
-
3. Run `fastfetch` or `neofetch`in a terminal inside the container and take a screenshot
301
+
3. Manually run `fastfetch` or `neofetch`in a terminal inside the container at runtime and take a screenshot
302
302
4. Create a merge request containing your changes.
303
303
304
304
#### 1. Create a Fork (Docker)
@@ -310,11 +310,11 @@ Fork and clone the repository mentioned above. The repository initially contains
310
310
- Currently, the [`Dockerfile`](https://docs.docker.com/reference/dockerfile/) is empty. Edit the file such that a container image with the following properties is built:
311
311
- Your virtual machine should be based on the [`alpine:latest` image](https://hub.docker.com/_/alpine).
312
312
- Alternatively, you can use the (larger) [`ubuntu:24.04` image](https://hub.docker.com/_/ubuntu).
313
-
- Create a new file with the name `testfile` and add it to the repository. The file should contain your `USERNAME` as text. Add the file to your container and place it in directory `/testfiles`.
314
-
- Set the environment variable `ENV_TEST_VARIABLE` to have the value of your `USERNAME`.
315
-
- Make sure that the default command to be executed when running the container is `/bin/bash`.
316
313
- Install `fastfetch` (Alpine) or `neofetch` (Ubuntu).
317
314
- **Note:** In the `Dockerfile` you do not have to prefix commands such as `apt` with `sudo` since the script is executed with superuser rights.
315
+
- Create a new file with the name `testfile` and add it to the repository. The file should contain your `USERNAME` as text. Add the file to your container and place it in directory `/testfiles` using `COPY`.
316
+
- Set the environment variable `ENV_TEST_VARIABLE` to have the value of your `USERNAME`.
317
+
- Make sure that the default command to be executed when running the container is `/bin/bash`.
318
318
- Test your Docker container locally. Are all variables set and files available?
319
319
- **Note:** If you rebuild your container often, you might end up with dangling containers. You can remove them (together with any unused images, containers, or objects) with [`docker [image|container|system] prune`)](https://docs.docker.com/engine/reference/commandline/system_prune/) depending on what you want to remove. To delete everything unused: `docker system prune`.
0 commit comments