Skip to content

Commit

Permalink
Define docker stages, especially for development without preinstalled…
Browse files Browse the repository at this point in the history
… lib
  • Loading branch information
orzechow committed Nov 4, 2024
1 parent b946da7 commit 84575b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:22.04 as base

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -23,6 +23,18 @@ RUN git clone https://github.com/KIT-MRT/util_caching.git /tmp/util_caching && \
rm -rf /tmp/util_caching



FROM base AS devel

RUN useradd --create-home --uid 1000 blinky
USER blinky

WORKDIR /home/blinky/



FROM base as install

# Install arbitration_graphs
COPY CMakeLists.txt /tmp/arbitration_graphs/
COPY cmake /tmp/arbitration_graphs/cmake
Expand All @@ -35,10 +47,4 @@ RUN mkdir /tmp/arbitration_graphs/build && \
cmake .. && \
cmake --build . && \
cmake --install . && \
rm -rf /tmp/arbitration_graphs

RUN useradd --create-home --uid 1000 blinky
USER blinky

WORKDIR /home/blinky/

rm -rf /tmp/arbitration_graphs
1 change: 1 addition & 0 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN git clone https://github.com/KIT-MRT/EnTT-Pacman.git --branch arbitration_gr
cmake --install . && \
rm -rf /tmp/EnTT-Pacman

RUN useradd --create-home --uid 1000 blinky
USER blinky

WORKDIR /home/blinky/demo
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ services:
build: .
env_file: .env
arbitration_graphs_devel:
build:
context: .
target: devel
extends:
service: arbitration_graphs
image: arbitration_graphs_devel
Expand Down

0 comments on commit 84575b0

Please sign in to comment.