Skip to content

Commit

Permalink
Simplify nsjail configs, remove ubuntu 18.04 from build
Browse files Browse the repository at this point in the history
  • Loading branch information
lecafard committed Jun 21, 2024
1 parent 2f74bce commit 238d694
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 67 deletions.
20 changes: 14 additions & 6 deletions vendor/bin-builder/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: '3'

services:
bin-builder-ubuntu-18.04:
bin-builder-ubuntu-22.04:
build:
context: ./context
dockerfile: ../dockerfiles/Dockerfile.ubuntu
args:
UBUNTU_VERSION: '18.04'
image: ${CONTAINER_PREFIX}/bin-builder:ubuntu-18.04
UBUNTU_VERSION: '22.04'
image: ${CONTAINER_PREFIX}/bin-builder:ubuntu-22.04

bin-builder-ubuntu-22.04:
bin-builder-ubuntu-24.04:
build:
context: ./context
dockerfile: ../dockerfiles/Dockerfile.ubuntu
args:
UBUNTU_VERSION: '22.04'
image: ${CONTAINER_PREFIX}/bin-builder:ubuntu-22.04
UBUNTU_VERSION: '24.04'
image: ${CONTAINER_PREFIX}/bin-builder:ubuntu-24.04

bin-builder-debian-10:
build:
Expand All @@ -24,6 +24,14 @@ services:
args:
DEBIAN_VERSION: '10'
image: ${CONTAINER_PREFIX}/bin-builder:debian-10

bin-builder-debian-11:
build:
context: ./context
dockerfile: ../dockerfiles/Dockerfile.debian
args:
DEBIAN_VERSION: '11'
image: ${CONTAINER_PREFIX}/bin-builder:debian-11

# Don't know why you'd need this but I like completionism
bin-builder-alpine:
Expand Down
32 changes: 25 additions & 7 deletions vendor/nsjail/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
version: '3'

services:
nsjail-ubuntu-18.04:
nsjail-ubuntu-22.04:
build:
context: ./context/
dockerfile: ../dockerfiles/Dockerfile.ubuntu-18.04
image: ${CONTAINER_PREFIX}/nsjail:ubuntu-18.04
dockerfile: ../dockerfiles/Dockerfile.ubuntu
args:
UBUNTU_VERSION: '22.04'
LIBPROTOBUF_VERSION: 'libprotobuf23'
image: ${CONTAINER_PREFIX}/nsjail:ubuntu-22.04

nsjail-ubuntu-22.04:
nsjail-ubuntu-24.04:
build:
context: ./context/
dockerfile: ../dockerfiles/Dockerfile.ubuntu-22.04
image: ${CONTAINER_PREFIX}/nsjail:ubuntu-22.04
dockerfile: ../dockerfiles/Dockerfile.ubuntu
args:
UBUNTU_VERSION: '24.04'
LIBPROTOBUF_VERSION: 'libprotobuf32t64'
image: ${CONTAINER_PREFIX}/nsjail:ubuntu-24.04

nsjail-debian-10:
build:
context: ./context/
dockerfile: ../dockerfiles/Dockerfile.debian-10
dockerfile: ../dockerfiles/Dockerfile.debian
args:
DEBIAN_VERSION: '10'
LIBPROTOBUF_VERSION: 'libprotobuf17'
image: ${CONTAINER_PREFIX}/nsjail:debian-10

nsjail-debian-11:
build:
context: ./context/
dockerfile: ../dockerfiles/Dockerfile.debian
args:
DEBIAN_VERSION: '11'
LIBPROTOBUF_VERSION: 'libprotobuf23'
image: ${CONTAINER_PREFIX}/nsjail:debian-11

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ARG DEBIAN_VERSION=10
ARG DEBIAN_VERSION
ARG LIBPROTOBUF_VERSION


FROM ghcr.io/downunderctf/docker-vendor/bin-builder:debian-$DEBIAN_VERSION as base

FROM base as build
ARG LIBPROTOBUF_VERSION
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -20,6 +23,7 @@ RUN apt-get update \
RUN git clone https://github.com/google/nsjail.git /nsjail && cd /nsjail && make

FROM debian:$DEBIAN_VERSION-slim as dist
ARG LIBPROTOBUF_VERSION
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -28,14 +32,14 @@ RUN dpkg --add-architecture i386 \
python3-venv \
python3-gmpy2 \
nano \
libprotobuf17 \
$LIBPROTOBUF_VERSION \
libnl-route-3-200 \
libc6:i386 \
libstdc++6:i386 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /nsjail/nsjail /usr/bin/nsjail
RUN useradd -r -m -u 1000 ctf
RUN useradd -r -m ctf

COPY docker-entrypoint.sh nsjail-launcher.sh nsjail-user.sh nsjail-config-cgroups.sh /docker-init/
RUN chmod +x /docker-init/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ARG UBUNTU_VERSION="22.04"
ARG UBUNTU_VERSION
ARG LIBPROTOBUF_VERSION


FROM ghcr.io/downunderctf/docker-vendor/bin-builder:ubuntu-$UBUNTU_VERSION as base

FROM base as build
ARG LIBPROTOBUF_VERSION
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -20,6 +23,7 @@ RUN apt-get update \
RUN git clone https://github.com/google/nsjail.git /nsjail && cd /nsjail && make

FROM ubuntu:$UBUNTU_VERSION as dist
ARG LIBPROTOBUF_VERSION
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -28,14 +32,14 @@ RUN dpkg --add-architecture i386 \
python3-gmpy2 \
python3-pip \
nano \
libprotobuf23 \
$LIBPROTOBUF_VERSION \
libnl-route-3-200 \
libc6:i386 \
libstdc++6:i386 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /nsjail/nsjail /usr/bin/nsjail
RUN useradd -r -m -u 1000 ctf
RUN useradd -r -m ctf

COPY docker-entrypoint.sh nsjail-launcher.sh nsjail-user.sh nsjail-config-cgroups.sh /docker-init/
RUN chmod +x /docker-init/*
Expand Down
48 changes: 0 additions & 48 deletions vendor/nsjail/dockerfiles/Dockerfile.ubuntu-18.04

This file was deleted.

0 comments on commit 238d694

Please sign in to comment.