Skip to content
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

10: Rust 1.76.0, yamlfmt now included #11

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading