Skip to content
This repository has been archived by the owner on Feb 8, 2025. It is now read-only.

Commit

Permalink
10: Rust 1.76.0, yamlfmt now included
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Feb 9, 2024
1 parent 4707339 commit 16bc7da
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
FROM debian:stable-slim as go-builder
# defined from build kit
# DOCKER_BUILDKIT=1 docker build . -t ...
ARG TARGETARCH

RUN export DEBIAN_FRONTEND=noninteractive && \
apt update && \
apt install -y -q --no-install-recommends \
git curl gnupg2 build-essential coreutils \
openssl libssl-dev pkg-config \
ca-certificates apt-transport-https \
python3 && \
apt clean && \
rm -rf /var/lib/apt/lists/*

## Go Lang
ARG GO_VERSION=1.22.0
ADD https://go.dev/dl/go${GO_VERSION}.linux-$TARGETARCH.tar.gz /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz
RUN echo 'SHA256 of this go source package...'
RUN cat /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz | sha256sum
RUN tar -C /usr/local -xzf /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz
WORKDIR /yamlfmt
ENV GOBIN=/usr/local/go/bin
ENV PATH=$PATH:${GOBIN}
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@latest
RUN ls -lR /usr/local/go/bin/yamlfmt && strip /usr/local/go/bin/yamlfmt && ls -lR /usr/local/go/bin/yamlfmt
RUN yamlfmt --version

FROM debian:stable-slim as builder
# defined from build kit
# DOCKER_BUILDKIT=1 docker build . -t ...
Expand Down Expand Up @@ -38,8 +66,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ca-certificates apt-transport-https \
sudo ripgrep procps build-essential \
python3 python3-pip python3-dev \
git curl protobuf-compiler \
valgrind && \
git curl protobuf-compiler valgrind \
openssl libssl-dev pkg-config \
&& \
apt clean && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -70,8 +99,9 @@ ENV USER=xmtp
## Rust from builder
COPY --chown=${USER}:${USER} --from=builder /home/${USER}/.cargo /home/${USER}/.cargo
COPY --chown=${USER}:${USER} --from=builder /home/${USER}/.rustup /home/${USER}/.rustup
COPY --chown=${USER}:${USER} --from=go-builder /usr/local/go/bin/yamlfmt /usr/local/go/bin/yamlfmt

ENV PATH=/home/${USER}/.cargo/bin:$PATH
ENV PATH=/home/${USER}/.cargo/bin:/usr/local/go/bin:$PATH
USER xmtp
RUN rustup toolchain install stable
RUN rustup component add rustfmt
Expand Down

0 comments on commit 16bc7da

Please sign in to comment.