diff --git a/Dockerfile b/Dockerfile index 633209fd0b8ae307295d0ce17249e00f4bcb4c32..2786c20c103a426977fcb2a096f6427172be1282 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,10 @@ FROM ubuntu:latest RUN yes | unminimize -RUN groupadd ost && useradd --no-log-init -m -g ost -G sudo -s /bin/bash ost +RUN groupadd ost \ + && useradd --no-log-init -m -g ost -G sudo -s /bin/bash ost \ + && mkdir /home/ost/exercises \ + && chown ost:ost /home/ost/exercises RUN apt-get update \ && apt-get install -y \ @@ -23,4 +26,6 @@ RUN apt-get update \ USER ost -WORKDIR /home/ost \ No newline at end of file +WORKDIR /home/ost/exercises + +VOLUME [ "/home/ost/exercises" ] \ No newline at end of file diff --git a/README.md b/README.md index 3f8c67101f5bce9300b656c3784ba81973169702..3ae1c9b14d8a79e1dd949979e1f9abed5760788c 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,23 @@ It contains necessary tools for the exercises "Betriebssysteme 1". ## How to run +### Docker plain + `docker run -d --name bsys1 registry.gitlab.ost.ch:45023/dominic.klinger/betriebssysteme-1-docker:latest sleep infinity` -### How to open shell +### Docker compose + +`mkdir -p exercises && docker compose up -d` + +### How to open shell plain `docker exec -it bsys1 /bin/bash` -### How to code +### How to open shell Docker compose + +`docker compose exec -it bsys1 /bin/bash` + +## How to code - Open Command Palette (Cmd+Shift+P) - Execute in Quick Open (Cmd+P) to install Dev Containers extension: `ext install ms-vscode-remote.remote-containers` or via marketplace https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..a07abbfb68c82e515a126a9ceaa90e044f86cfef --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + bsys1: + image: registry.gitlab.ost.ch:45023/dominic.klinger/betriebssysteme-1-docker:latest + command: "sleep infinity" + user: ost + volumes: + - ./exercises:/home/ost/exercises \ No newline at end of file diff --git a/exercises/test b/exercises/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391