+60
-2
@@ -14,9 +14,42 @@ ENV PYTHONUNBUFFERED=1 \
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git curl wget vim ack ca-certificates build-essential libpq-dev \
|
||||
tmux apache2-utils procps htop iftop iotop netcat-openbsd zip unzip \
|
||||
fakeroot \
|
||||
fakeroot xz-utils pkg-config \
|
||||
binutils gnupg2 libc6-dev libcurl4-openssl-dev libedit2 libedit-dev \
|
||||
libncurses-dev libpython3-dev libsqlite3-0 libsqlite3-dev uuid-dev \
|
||||
libxml2-dev libz3-dev tzdata zlib1g-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV RUSTUP_HOME=/opt/rust/rustup \
|
||||
CARGO_HOME=/opt/rust/cargo \
|
||||
CHOOSENIM_HOME=/opt/nim/choosenim \
|
||||
CHOOSENIM_DIR=/opt/nim/toolchains \
|
||||
NIMBLE_DIR=/opt/nim/nimble \
|
||||
SWIFTLY_HOME_DIR=/opt/swift/swiftly \
|
||||
SWIFTLY_BIN_DIR=/opt/swift/bin \
|
||||
SWIFT_HOME=/opt/swift/toolchain
|
||||
|
||||
RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal \
|
||||
&& rm -rf "$CARGO_HOME/registry" "$CARGO_HOME/git" \
|
||||
&& "$CARGO_HOME/bin/rustc" --version
|
||||
|
||||
RUN curl -fsSL https://nim-lang.org/choosenim/init.sh | sh -s -- -y || true; \
|
||||
rm -rf "$CHOOSENIM_HOME/downloads"; \
|
||||
"$NIMBLE_DIR/bin/nim" --version | head -1
|
||||
|
||||
RUN set -eu; \
|
||||
curl -fsSL "https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz" -o /tmp/swiftly.tar.gz; \
|
||||
mkdir -p /tmp/swiftly-unpack; \
|
||||
tar -xzf /tmp/swiftly.tar.gz -C /tmp/swiftly-unpack; \
|
||||
/tmp/swiftly-unpack/swiftly init --assume-yes --skip-install --no-modify-profile; \
|
||||
"$SWIFTLY_BIN_DIR/swiftly" install latest --assume-yes; \
|
||||
toolchain="$(find /root/.local/share/swiftly/toolchains -mindepth 1 -maxdepth 1 -type d | head -1)"; \
|
||||
[ -n "$toolchain" ] || { echo "swift toolchain not found after install"; exit 1; }; \
|
||||
mv "$toolchain" /opt/swift/toolchain; \
|
||||
rm -rf /tmp/swiftly.tar.gz /tmp/swiftly-unpack /root/.local/share/swiftly \
|
||||
"$SWIFTLY_HOME_DIR" "$SWIFTLY_BIN_DIR"; \
|
||||
/opt/swift/toolchain/usr/bin/swift --version
|
||||
|
||||
FROM base AS deps
|
||||
RUN pip install \
|
||||
pip setuptools wheel packaging \
|
||||
@@ -68,6 +101,31 @@ RUN set -eu; \
|
||||
done
|
||||
|
||||
USER pravda
|
||||
ENV PATH=/home/pravda/.local/bin:$PATH
|
||||
ENV PATH=/home/pravda/.local/bin:/opt/rust/cargo/bin:/opt/nim/nimble/bin:/opt/swift/toolchain/usr/bin:$PATH \
|
||||
DEVPLACE_TOOLCHAINS=python,rust,nim,swift
|
||||
WORKDIR /app
|
||||
|
||||
RUN printf '%s\n' \
|
||||
'export RUSTUP_HOME=/opt/rust/rustup' \
|
||||
'export CARGO_HOME=/opt/rust/cargo' \
|
||||
'export NIMBLE_DIR=/opt/nim/nimble' \
|
||||
'export SWIFT_HOME=/opt/swift/toolchain' \
|
||||
'export DEVPLACE_TOOLCHAINS=python,rust,nim,swift' \
|
||||
'export PATH=/home/pravda/.local/bin:/opt/rust/cargo/bin:/opt/nim/nimble/bin:/opt/swift/toolchain/usr/bin:$PATH' \
|
||||
> /etc/profile.d/devplace-toolchains.sh \
|
||||
&& chmod 0644 /etc/profile.d/devplace-toolchains.sh
|
||||
|
||||
RUN set -eu; \
|
||||
for tool in "python --version" "rustc --version" "cargo --version" \
|
||||
"nim --version" "nimble --version" "swift --version"; do \
|
||||
$tool > /tmp/toolcheck 2>&1 || { echo "TOOLCHAIN FAILED: $tool"; cat /tmp/toolcheck; exit 1; }; \
|
||||
head -1 /tmp/toolcheck; \
|
||||
done; \
|
||||
rm -f /tmp/toolcheck; \
|
||||
for b in /usr/local/bin/sudo /usr/local/bin/aptroot /usr/bin/pagent.py \
|
||||
/usr/bin/botje.py /usr/bin/d.py /usr/bin/dpc; do \
|
||||
[ -x "$b" ] || { echo "missing or not executable: $b"; exit 1; }; \
|
||||
done; \
|
||||
[ -f /home/pravda/.vimrc ] || { echo "missing /home/pravda/.vimrc"; exit 1; }
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
Reference in New Issue
Block a user