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

Commit b746d4f

Browse files
committedFeb 9, 2024
10: Rust 1.76.0, yamlfmt now included
1 parent c13796b commit b746d4f

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed
 

‎Dockerfile

+33-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
FROM debian:stable-slim as go-builder
2+
# defined from build kit
3+
# DOCKER_BUILDKIT=1 docker build . -t ...
4+
ARG TARGETARCH
5+
6+
RUN export DEBIAN_FRONTEND=noninteractive && \
7+
apt update && \
8+
apt install -y -q --no-install-recommends \
9+
git curl gnupg2 build-essential coreutils \
10+
openssl libssl-dev pkg-config \
11+
ca-certificates apt-transport-https \
12+
python3 && \
13+
apt clean && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
## Go Lang
17+
ARG GO_VERSION=1.22.0
18+
ADD https://go.dev/dl/go${GO_VERSION}.linux-$TARGETARCH.tar.gz /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz
19+
RUN echo 'SHA256 of this go source package...'
20+
RUN cat /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz | sha256sum
21+
RUN tar -C /usr/local -xzf /goinstall/go${GO_VERSION}.linux-$TARGETARCH.tar.gz
22+
WORKDIR /yamlfmt
23+
ENV GOBIN=/usr/local/go/bin
24+
ENV PATH=$PATH:${GOBIN}
25+
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@latest
26+
RUN ls -lR /usr/local/go/bin/yamlfmt && strip /usr/local/go/bin/yamlfmt && ls -lR /usr/local/go/bin/yamlfmt
27+
RUN yamlfmt --version
28+
129
FROM debian:stable-slim as builder
230
# defined from build kit
331
# DOCKER_BUILDKIT=1 docker build . -t ...
@@ -38,8 +66,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
3866
ca-certificates apt-transport-https \
3967
sudo ripgrep procps build-essential \
4068
python3 python3-pip python3-dev \
41-
git curl protobuf-compiler \
42-
valgrind && \
69+
git curl protobuf-compiler valgrind \
70+
openssl libssl-dev pkg-config \
71+
&& \
4372
apt clean && \
4473
rm -rf /var/lib/apt/lists/*
4574

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

74-
ENV PATH=/home/${USER}/.cargo/bin:$PATH
104+
ENV PATH=/home/${USER}/.cargo/bin:/usr/local/go/bin:$PATH
75105
USER xmtp
76106
RUN rustup toolchain install stable
77107
RUN rustup component add rustfmt

0 commit comments

Comments
 (0)
This repository has been archived.