Skip to content

Commit

Permalink
chore: Make the qns image multiarch & shrink the build context further (
Browse files Browse the repository at this point in the history
#1589)

* chore: Make the qns image multiarch, and shrink the build context further

* Remove some more things

* Update .dockerignore

Co-authored-by: Max Inden <[email protected]>

* Update qns/Dockerfile

Co-authored-by: Martin Thomson <[email protected]>

* Update qns/Dockerfile

* Update .dockerignore

---------

Co-authored-by: Max Inden <[email protected]>
Co-authored-by: Martin Thomson <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2024
1 parent 37f121d commit fca2179
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
12 changes: 9 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
nss
nspr
target
# Ignore everything:
*
# Except for the following:
!**/*.toml
!**/*.rs
!**/*.h
!**/*.hpp
!qns
!Cargo.lock
17 changes: 6 additions & 11 deletions qns/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM martenseemann/quic-network-simulator-endpoint:latest AS buildimage

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates coreutils curl git make mercurial ssh \
build-essential clang llvm libclang-dev lld \
gyp ninja-build pkg-config zlib1g-dev python \
curl git mercurial \
build-essential libclang-dev lld \
gyp ninja-build zlib1g-dev python \
&& apt-get autoremove -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -13,20 +13,15 @@ ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN set -eux; \
curl -sSLf "https://static.rust-lang.org/rustup/archive/1.26.0/x86_64-unknown-linux-gnu/rustup-init" -o rustup-init; \
echo '0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db *rustup-init' | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y -q --no-modify-path --profile minimal --default-toolchain "$RUST_VERSION"; \
rm -f rustup-init; \
chmod -R a+w "$RUSTUP_HOME" "$CARGO_HOME"
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- -y -q --no-modify-path --profile minimal --default-toolchain $RUST_VERSION

ENV NSS_DIR=/nss \
NSPR_DIR=/nspr \
LD_LIBRARY_PATH=/dist/Release/lib

RUN set -eux; \
hg clone https://hg.mozilla.org/projects/nss "$NSS_DIR"; \
git clone --depth=1 https://github.com/nss-dev/nss "$NSS_DIR"; \
hg clone https://hg.mozilla.org/projects/nspr "$NSPR_DIR"

RUN "$NSS_DIR"/build.sh --static -Ddisable_tests=1 -o
Expand Down

0 comments on commit fca2179

Please sign in to comment.