Skip to content

Commit

Permalink
Merge pull request #64 from KIT-MRT/improve_docker
Browse files Browse the repository at this point in the history
Improve docker images (versioning, cleanup)
  • Loading branch information
orzechow authored Oct 30, 2024
2 parents c75f358 + 68c648d commit 233d800
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 17 deletions.
1 change: 1 addition & 0 deletions .env
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .. && \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions demo/.env
5 changes: 3 additions & 2 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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" ]

10 changes: 8 additions & 2 deletions demo/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions docker-compose.devel.yaml

This file was deleted.

11 changes: 9 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
services:
arbitration_graphs:
image: arbitration_graphs
build: .
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
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION=v0.0.1

0 comments on commit 233d800

Please sign in to comment.