Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Dockerfile #239

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM ubuntu:18.04
FROM debian:bookworm-slim AS base

# Install run-time dependencies in base image
RUN apt-get -y update && apt-get install -y \
libc6 \
libstdc++6 \
libprotobuf32 \
libnl-route-3-200

FROM base AS build

# Install build dependencies only in builder image
RUN apt-get install -y \
autoconf \
bison \
flex \
Expand All @@ -12,9 +22,14 @@ RUN apt-get -y update && apt-get install -y \
libtool \
make \
pkg-config \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
protobuf-compiler

COPY . /nsjail

RUN cd /nsjail && make && mv /nsjail/nsjail /bin && rm -rf -- /nsjail
RUN cd /nsjail && make clean && make

FROM base AS run

# Copy over build result and trim image
RUN rm -rf /var/lib/apt/lists/*
COPY --from=build /nsjail/nsjail /bin
Loading