Skip to content

Commit

Permalink
Update golang version in docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
0x00101010 committed Sep 30, 2024
1 parent d5a5878 commit 05b6bd2
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions cannon/Dockerfile.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.22.5-alpine3.20 as builder

RUN apk add --no-cache make bash

Expand Down Expand Up @@ -30,5 +30,5 @@ COPY --from=cannon-v1 /usr/local/bin/cannon /usr/local/bin/cannon-v1
# verify the latest singlethreaded VM behavior against cannon-v1
RUN cd cannon && make diff-singlethreaded-cannon -e OTHER_CANNON=/usr/local/bin/cannon-v1
RUN --mount=type=cache,target=/root/.cache/go-build cd cannon && \
make diff-singlethreaded-cannon -e OTHER_CANNON=/usr/local/bin/cannon-v1 \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE
make diff-singlethreaded-cannon -e OTHER_CANNON=/usr/local/bin/cannon-v1 \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE
4 changes: 2 additions & 2 deletions cannon/testdata/example/alloc/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module alloc

go 1.21
go 1.22

toolchain go1.21.1
toolchain go1.22.5

require github.com/ethereum-optimism/optimism v0.0.0

Expand Down
4 changes: 2 additions & 2 deletions cannon/testdata/example/claim/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module claim

go 1.21
go 1.22

toolchain go1.21.1
toolchain go1.22.5

require github.com/ethereum-optimism/optimism v0.0.0

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/ethereum-optimism/optimism

go 1.22

toolchain go1.23.0
toolchain go1.22.5

require (
github.com/BurntSushi/toml v1.4.0
Expand Down
2 changes: 1 addition & 1 deletion op-alt-da/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack
FROM $OP_STACK_GO_BUILDER as builder
# See "make golang-docker" and /ops/docker/op-stack-go

FROM alpine:3.18
FROM alpine:3.20

COPY --from=builder /usr/local/bin/da-server /usr/local/bin/da-server

Expand Down
2 changes: 1 addition & 1 deletion op-dispute-mon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack
FROM $OP_STACK_GO_BUILDER as builder
# See "make golang-docker" and /ops/docker/op-stack-go

FROM alpine:3.18
FROM alpine:3.20

COPY --from=builder /usr/local/bin/op-dispute-mon /usr/local/bin/op-dispute-mon

Expand Down
8 changes: 4 additions & 4 deletions op-program/Dockerfile.repro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.22.5-alpine3.20 as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash

Expand Down Expand Up @@ -28,11 +28,11 @@ ARG TARGETOS TARGETARCH

# Build the cannon, op-program, and op-program-client.elf binaries.
RUN --mount=type=cache,target=/root/.cache/go-build cd cannon && make cannon \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$CANNON_VERSION"
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$CANNON_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-program && make op-program-host \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION"
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION"
RUN --mount=type=cache,target=/root/.cache/go-build cd op-program && make op-program-client-mips \
GOOS=linux GOARCH=mips GOMIPS=softfloat GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION"
GOOS=linux GOARCH=mips GOMIPS=softfloat GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION"

# Run the op-program-client.elf binary directly through cannon's load-elf subcommand.
RUN /app/cannon/bin/cannon load-elf --type singlethreaded-2 --path /app/op-program/bin/op-program-client.elf --out /app/op-program/bin/prestate.bin.gz --meta ""
Expand Down
4 changes: 2 additions & 2 deletions op-program/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ From within the `op-program` directory, options can be reviewed with:
The absolute pre-state of the op-program can be generated by executing the makefile
`reproducible-prestate` target. Effectively, this builds a docker image specified
by [Dockerfile.repro](./Dockerfile.repro) pinned with the following dependencies:
- golang version `1.21.3`
- alpine `3.18`
- golang version `1.22.5`
- alpine `3.20`

After running `make reproducible-prestate`, the following files can be found in
[./bin/](./bin/):
Expand Down
2 changes: 1 addition & 1 deletion ops/docker/ci-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FROM --platform=linux/amd64 debian:bullseye-slim as go-build

RUN apt-get update && apt-get install -y curl ca-certificates jq binutils

ENV GO_VERSION=1.21.1
ENV GO_VERSION=1.22.5

# Fetch go manually, rather than using a Go base image, so we can copy the installation into the final stage
RUN curl -sL https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz -o go$GO_VERSION.linux-amd64.tar.gz && \
Expand Down
4 changes: 2 additions & 2 deletions ops/docker/deployment-utils/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.1-bookworm AS go-base
FROM golang:1.22.5-bookworm AS go-base

RUN go install github.com/tomwright/dasel/v2/cmd/dasel@master

Expand Down Expand Up @@ -32,4 +32,4 @@ SHELL ["/bin/bash", "-c"]
COPY --from=base /root/.foundry/bin/forge /usr/local/bin/forge
COPY --from=base /root/.foundry/bin/cast /usr/local/bin/cast
COPY --from=base /root/.foundry/bin/anvil /usr/local/bin/anvil
COPY --from=go-base /go/bin/dasel /usr/local/bin/dasel
COPY --from=go-base /go/bin/dasel /usr/local/bin/dasel
4 changes: 2 additions & 2 deletions ops/docker/op-stack-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

# All target images use this as base image, and add the final build results.
# It will default to the target platform.
ARG TARGET_BASE_IMAGE=alpine:3.18
ARG TARGET_BASE_IMAGE=alpine:3.20

# We may be cross-building for another platform. Specify which platform we need as builder.
FROM --platform=$BUILDPLATFORM golang:1.21.3-alpine3.18 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine3.20 AS builder

RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash

Expand Down

0 comments on commit 05b6bd2

Please sign in to comment.