diff --git a/.env b/.env new file mode 120000 index 00000000..ca291e96 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +version \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 769499f4..f3bf2b32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,11 @@ RUN git clone https://github.com/KIT-MRT/util_caching.git /tmp/util_caching && \ # Install arbitration_graphs -COPY . /tmp/arbitration_graphs +COPY CMakeLists.txt /tmp/arbitration_graphs/ +COPY cmake /tmp/arbitration_graphs/cmake +COPY include /tmp/arbitration_graphs/include +COPY test /tmp/arbitration_graphs/test + RUN mkdir /tmp/arbitration_graphs/build && \ cd /tmp/arbitration_graphs/build && \ cmake .. && \ diff --git a/README.md b/README.md index 4a51aa3d..2f59e6cc 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ Follow the steps above to setup the Docker image. Then, run the development image. ```bash -docker compose -f docker-compose.devel.yaml build -docker compose -f docker-compose.devel.yaml run --rm arbitration_graphs_devel +docker compose build +docker compose run --rm arbitration_graphs_devel ``` This mounts the source into the container's `/home/blinky/arbitration_graphs` folder. diff --git a/demo/.env b/demo/.env new file mode 120000 index 00000000..4a82335f --- /dev/null +++ b/demo/.env @@ -0,0 +1 @@ +../.env \ No newline at end of file diff --git a/demo/Dockerfile b/demo/Dockerfile index c91db76e..a3e949cc 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -1,4 +1,5 @@ -FROM ghcr.io/kit-mrt/arbitration_graphs:latest AS tutorial +ARG VERSION +FROM ghcr.io/kit-mrt/arbitration_graphs:$VERSION AS tutorial USER root @@ -33,7 +34,7 @@ COPY --chown=blinky:blinky CMakeLists.txt /home/blinky/demo/CMakeLists.txt WORKDIR /home/blinky/demo/build RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \ - cmake --build . + cmake --build . -j8 CMD [ "/home/blinky/demo/build/arbitration_graphs_pacman_demo_exe" ] diff --git a/demo/docker-compose.yaml b/demo/docker-compose.yaml index 6f259731..5dcb68e1 100644 --- a/demo/docker-compose.yaml +++ b/demo/docker-compose.yaml @@ -1,9 +1,12 @@ services: tutorial: + image: ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:$VERSION build: context: . + args: + - VERSION=$VERSION target: tutorial - image: arbitration_graphs_pacman_tutorial + env_file: .env volumes: - .:/home/blinky/demo - $HOME/.Xauthority:/home/blinky/.Xauthority @@ -12,10 +15,13 @@ services: - DISPLAY=$DISPLAY demo: + image: ghcr.io/kit-mrt/arbitration_graphs_pacman_demo:$VERSION build: context: . + args: + - VERSION=$VERSION target: demo - image: arbitration_graphs_pacman_demo + env_file: .env volumes: - $HOME/.Xauthority:/home/blinky/.Xauthority - /tmp/.X11-unix:/tmp/.X11-unix diff --git a/docker-compose.devel.yaml b/docker-compose.devel.yaml deleted file mode 100644 index a7200ba9..00000000 --- a/docker-compose.devel.yaml +++ /dev/null @@ -1,8 +0,0 @@ -services: - arbitration_graphs_devel: - extends: - file: docker-compose.yaml - service: arbitration_graphs - image: arbitration_graphs_devel - volumes: - - .:/home/blinky/arbitration_graphs \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 2224e4b6..32e507e7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,11 @@ services: arbitration_graphs: - image: arbitration_graphs - build: . \ No newline at end of file + image: ghcr.io/kit-mrt/arbitration_graphs:$VERSION + build: . + env_file: .env + arbitration_graphs_devel: + extends: + service: arbitration_graphs + image: arbitration_graphs_devel + volumes: + - .:/home/blinky/arbitration_graphs diff --git a/version b/version new file mode 100644 index 00000000..9939df2c --- /dev/null +++ b/version @@ -0,0 +1 @@ +VERSION=v0.0.1 \ No newline at end of file