From 3ec3abc4a988385b131712cb6e747d4b9ae2f389 Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Tue, 29 Oct 2024 16:05:24 +0100 Subject: [PATCH] Use explicit versions when building docker images --- .env | 1 + demo/Dockerfile | 3 ++- demo/docker-compose.yaml | 10 ++++++++-- docker-compose.yaml | 5 +++-- version | 1 + 5 files changed, 15 insertions(+), 5 deletions(-) create mode 120000 .env create mode 100644 version 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/demo/Dockerfile b/demo/Dockerfile index c91db76e..2ff5378e 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 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.yaml b/docker-compose.yaml index 2224e4b6..7df020f1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,5 @@ 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 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