Skip to content

Commit

Permalink
Optimizes docker layer (#337)
Browse files Browse the repository at this point in the history
* Adds copy all files in a sigle layer command

* Removes unused docker layer

* Changes debian image to ubuntu

Co-authored-by: Albrecht <albrecht@kilt.io>
(cherry picked from commit 76025b1)
  • Loading branch information
ggera authored and ntn-x2 committed Mar 25, 2022
1 parent 7711a07 commit 99e80ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.github
.gitignore
.gitlab-ci.yml
.rustfmt.toml
**/.maintain*
**/target*
**/*.rs.bk
*.iml
Expand Down
21 changes: 1 addition & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
COPY . .

RUN cargo build --locked --release --features $FEATURES

Expand All @@ -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 && \
Expand Down

0 comments on commit 99e80ac

Please sign in to comment.