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 6, 2024
1 parent a042510 commit eb7b778
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 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 @@ -10,6 +10,19 @@ RUN apt-get update && \
libgtest-dev && \
apt-get clean



FROM base AS devel

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

WORKDIR /home/blinky/



FROM base AS install

# Install util_caching
COPY . /tmp/util_caching
RUN mkdir /tmp/util_caching/build && \
Expand All @@ -18,10 +31,3 @@ RUN mkdir /tmp/util_caching/build && \
cmake --build . && \
cmake --install . && \
rm -rf /tmp/util_caching


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

WORKDIR /home/blinky/

11 changes: 10 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
services:
util_caching:
image: util_caching
build: .
build: .
util_caching_devel:
build:
context: .
target: devel
extends:
service: util_caching
image: util_caching_devel
volumes:
- .:/home/blinky/util_caching

0 comments on commit eb7b778

Please sign in to comment.