|
| 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 | + |
1 | 29 | FROM debian:stable-slim as builder
|
2 | 30 | # defined from build kit
|
3 | 31 | # DOCKER_BUILDKIT=1 docker build . -t ...
|
@@ -38,8 +66,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
|
38 | 66 | ca-certificates apt-transport-https \
|
39 | 67 | sudo ripgrep procps build-essential \
|
40 | 68 | 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 | + && \ |
43 | 72 | apt clean && \
|
44 | 73 | rm -rf /var/lib/apt/lists/*
|
45 | 74 |
|
@@ -70,8 +99,9 @@ ENV USER=xmtp
|
70 | 99 | ## Rust from builder
|
71 | 100 | COPY --chown=${USER}:${USER} --from=builder /home/${USER}/.cargo /home/${USER}/.cargo
|
72 | 101 | 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 |
73 | 103 |
|
74 |
| -ENV PATH=/home/${USER}/.cargo/bin:$PATH |
| 104 | +ENV PATH=/home/${USER}/.cargo/bin:/usr/local/go/bin:$PATH |
75 | 105 | USER xmtp
|
76 | 106 | RUN rustup toolchain install stable
|
77 | 107 | RUN rustup component add rustfmt
|
|
0 commit comments