add dev container

main
3029257 2026-10-12 10:21:49 +02:00
parent 535c4ad568
commit c8ee596676
4 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# [Choice] Debian OS version: trixie, bookworm
ARG VARIANT="trixie"
FROM rust:1-${VARIANT}
# Fixing vulnerability issue by upgrading svn to 1.14.5. Ref https://subversion.apache.org/security/CVE-2024-46901-advisory.txt
COPY ./scripts/install-subversion.sh /tmp/install-subversion.sh
RUN chmod +x /tmp/install-subversion.sh
RUN /tmp/install-subversion.sh \
&& rm -f /tmp/install-subversion.sh
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@ -0,0 +1,19 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.7.1",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:e76a6a8a35d1ad824daad1540725e0ec9f8ed2dc00d2850e990a9830013c7d08",
"integrity": "sha256:e76a6a8a35d1ad824daad1540725e0ec9f8ed2dc00d2850e990a9830013c7d08"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "1.3.8",
"resolved": "ghcr.io/devcontainers/features/git@sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2",
"integrity": "sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2"
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "1.6.0",
"resolved": "ghcr.io/devcontainers/features/rust@sha256:846c949f52c9dea98d4f90a11957cbf152fb3f6e8a70ddd7cb83014a7d1d0c98",
"integrity": "sha256:846c949f52c9dea98d4f90a11957cbf152fb3f6e8a70ddd7cb83014a7d1d0c98"
}
}
}

View File

@ -0,0 +1,29 @@
{
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/rust:1": "latest",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

View File

@ -0,0 +1,43 @@
#!/bin/bash
set -eux
REQUIRED="1.14.5"
# Determine current svn version if present
current=""
if command -v svn >/dev/null 2>&1; then
current="$(svn --version --quiet 2>/dev/null || true)"
fi
# If current version is >= REQUIRED, skip building
if [ -n "${current}" ] && dpkg --compare-versions "${current}" ge "${REQUIRED}"; then
echo "Subversion ${current} is >= ${REQUIRED}; skipping build."
exit 0
fi
URL="https://archive.apache.org/dist/subversion/subversion-1.14.5.tar.gz"
TMP="/tmp"
TARBALL="subversion-1.14.5.tar.gz"
SRCDIR="subversion-1.14.5"
if wget -q -O "${TMP}/${TARBALL}" "${URL}"; then
echo "Downloaded ${TARBALL} — building..."
apt-get remove -y subversion libsvn1 || true
cd "${TMP}"
tar -xzf "${TARBALL}"
cd "${SRCDIR}"
apt-get update -y
apt-get install -y --no-install-recommends build-essential autoconf libtool libsqlite3-dev pkg-config libapr1-dev libaprutil1-dev liblz4-dev libutf8proc-dev zlib1g-dev
./configure --with-lz4=internal --prefix=/usr
make -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)"
make install
cd /
rm -rf "${TMP:?}/${SRCDIR}" "${TMP:?}/${TARBALL}"
apt-get purge -y --auto-remove build-essential autoconf libtool pkg-config
rm -rf /var/lib/apt/lists/*
echo "Subversion built and installed (build deps removed)"
else
echo "Downloading svn source failed, skipping Subversion build"
fi