-
Notifications
You must be signed in to change notification settings - Fork 47
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
Optimizes docker layer #337
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
.github | ||
.gitignore | ||
.gitlab-ci.yml | ||
.rustfmt.toml | ||
**/.maintain* | ||
**/target* | ||
**/*.rs.bk | ||
*.iml | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,7 @@ WORKDIR /build | |
|
||
ARG FEATURES=default | ||
|
||
COPY ./nodes /build/nodes | ||
COPY ./pallets /build/pallets | ||
COPY ./runtimes /build/runtimes | ||
COPY ./support /build/support | ||
COPY ./Cargo.lock /build/Cargo.lock | ||
COPY ./Cargo.toml /build/Cargo.toml | ||
Comment on lines
-11
to
-16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither new nor old are great. If there is any layer caching at all, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the tip! We had dependency caching in our Dockerfile a while ago but experienced some issues. In the end there where some compile errors because of the dependency caching. This and the not so huge improvement by the cache lead us to remove the caching again. Last time we where hoping that cargo-wharf would solve the caching, but it looks like no development was done in 2y. |
||
COPY . . | ||
|
||
RUN cargo build --locked --release --features $FEATURES | ||
|
||
|
@@ -24,20 +19,6 @@ LABEL description="This is the 2nd stage: a very small image where we copy the k | |
|
||
ARG NODE_TYPE=kilt-parachain | ||
|
||
# install tools and dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
libssl1.1 \ | ||
ca-certificates \ | ||
curl && \ | ||
# apt cleanup | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
find /var/lib/apt/lists/ -type f -not -name lock -delete | ||
|
||
COPY ./LICENSE /build/LICENSE | ||
COPY ./README.md /build/README.md | ||
COPY --from=builder /build/target/release/$NODE_TYPE /usr/local/bin/node-executable | ||
|
||
RUN useradd -m -u 1000 -U -s /bin/sh -d /node node && \ | ||
|
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.
Ignoring everything and the un-ignoring things that are actually needed for build is typically a more productive approach than block-listing