-
Notifications
You must be signed in to change notification settings - Fork 191
refactor(container): reduce layers and image size. Add .devcontainer.json
sample.
#192
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
refactor(container): reduce layers and image size
- Combines the RUN commands to reduce image layers where possible. - Clean apt/dnf package cache and remove downloaded package files.
- Loading branch information
commit 0dba2b2d3b31ed4bfd50bd942b0f1b5b5bafdc68
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | ||
|
||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
build-essential \ | ||
curl \ | ||
clang \ | ||
libssl-dev \ | ||
libtinfo-dev \ | ||
pkg-config \ | ||
xz-utils \ | ||
zlib1g-dev | ||
zlib1g-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Needed to build `path_tracer`, `optix/ex03_window` example | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
cmake \ | ||
libfontconfig-dev \ | ||
libx11-xcb-dev \ | ||
libxcursor-dev \ | ||
libxi-dev \ | ||
libxinerama-dev \ | ||
libxrandr-dev | ||
libxrandr-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
jorge-ortega marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Get LLVM 7 | ||
WORKDIR /data/llvm7 | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb | ||
RUN apt-get install -y ./*.deb | ||
RUN ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb && \ | ||
apt-get update && apt-get install -y ./*.deb && \ | ||
ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config && \ | ||
rm -rf ./*.deb && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Get Rust | ||
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Setup the workspace | ||
ADD ./rust-toolchain.toml /data/Rust-CUDA/ | ||
WORKDIR /data/Rust-CUDA | ||
RUN rustup show | ||
RUN rm -f "rust-toolchain.toml" | ||
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/Rust-CUDA/rust-toolchain.toml \ | ||
rustup show | ||
|
||
# Add nvvm to LD_LIBRARY_PATH. | ||
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}" | ||
|
||
ENV LLVM_LINK_STATIC=1 | ||
ENV RUST_LOG=info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04 | ||
|
||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
build-essential \ | ||
curl \ | ||
clang \ | ||
libssl-dev \ | ||
libtinfo-dev \ | ||
pkg-config \ | ||
xz-utils \ | ||
zlib1g-dev | ||
zlib1g-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Needed to build `path_tracer`, `optix/ex03_window` example | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
cmake \ | ||
libfontconfig-dev \ | ||
libx11-xcb-dev \ | ||
libxcursor-dev \ | ||
libxi-dev \ | ||
libxinerama-dev \ | ||
libxrandr-dev | ||
libxrandr-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Get LLVM 7 | ||
WORKDIR /data/llvm7 | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb | ||
RUN apt-get install -y ./*.deb | ||
RUN ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb && \ | ||
apt-get update && apt-get install -y ./*.deb && \ | ||
ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config && \ | ||
rm -rf ./*.deb && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Get Rust | ||
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Setup the workspace | ||
ADD ./rust-toolchain.toml /data/Rust-CUDA/ | ||
WORKDIR /data/Rust-CUDA | ||
RUN rustup show | ||
RUN rm -f "rust-toolchain.toml" | ||
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/Rust-CUDA/rust-toolchain.toml \ | ||
rustup show | ||
|
||
# Add nvvm to LD_LIBRARY_PATH. | ||
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}" | ||
|
||
ENV LLVM_LINK_STATIC=1 | ||
ENV RUST_LOG=info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 | ||
|
||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
build-essential \ | ||
clang \ | ||
curl \ | ||
libssl-dev \ | ||
libtinfo-dev \ | ||
pkg-config \ | ||
xz-utils \ | ||
zlib1g-dev | ||
zlib1g-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Needed to build `path_tracer`, `optix/ex03_window` example | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | ||
cmake \ | ||
libfontconfig-dev \ | ||
libx11-xcb-dev \ | ||
libxcursor-dev \ | ||
libxi-dev \ | ||
libxinerama-dev \ | ||
libxrandr-dev | ||
libxrandr-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Get LLVM 7 & libffi7 | ||
WORKDIR /data/llvm7 | ||
RUN curl -sSf -L -O http://security.ubuntu.com/ubuntu/pool/universe/libf/libffi7/libffi7_3.3-5ubuntu1_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb | ||
RUN curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb | ||
RUN apt-get install -y ./*.deb | ||
RUN ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config | ||
RUN curl -sSf -L -O http://security.ubuntu.com/ubuntu/pool/universe/libf/libffi7/libffi7_3.3-5ubuntu1_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-dev_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/libllvm7_7.0.1-12_amd64.deb && \ | ||
curl -sSf -L -O http://mirrors.kernel.org/ubuntu/pool/universe/l/llvm-toolchain-7/llvm-7-runtime_7.0.1-12_amd64.deb && \ | ||
apt-get install -y ./*.deb && \ | ||
ln -s /usr/bin/llvm-config-7 /usr/bin/llvm-config && \ | ||
rm -rf ./*.deb && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Get Rust | ||
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Setup the workspace | ||
ADD ./rust-toolchain.toml /data/Rust-CUDA/ | ||
WORKDIR /data/Rust-CUDA | ||
RUN rustup show | ||
RUN rm -f "rust-toolchain.toml" | ||
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/Rust-CUDA/rust-toolchain.toml \ | ||
rustup show | ||
|
||
# Add nvvm to LD_LIBRARY_PATH. | ||
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}" | ||
|
||
ENV LLVM_LINK_STATIC=1 | ||
ENV RUST_LOG=info |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging curl RUNs are fine since I think no many people would like to modify it.