Skip to content

Commit

Permalink
Ensure Dockerfile stages use consistent Go version (tendermint#9462)
Browse files Browse the repository at this point in the history
I noticed the tendermint image was running on Go 1.15. I assume that was just a missed search and replace when updating to go1.18.

Pull the go base image into a build arg so that the image is only defined once, and used consistently across all stages of the build.

#### PR checklist

- [x] Tests written/updated, or no tests needed
- [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [x] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed
  • Loading branch information
mark-rushakoff authored Sep 21, 2022
1 parent fbcfecb commit 84bc77c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

### BUG FIXES

- [docker] \#9462 ensure Docker image uses consistent version of Go

## v0.37.0

Special thanks to external contributors on this release:
Expand Down
8 changes: 6 additions & 2 deletions DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Use a build arg to ensure that both stages use the same,
# hopefully current, go version.
ARG GOLANG_BASE_IMAGE=golang:1.18-alpine

# stage 1 Generate Tendermint Binary
FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder
RUN apk update && \
apk upgrade && \
apk --no-cache add make
Expand All @@ -8,7 +12,7 @@ WORKDIR /tendermint
RUN TARGETPLATFORM=$TARGETPLATFORM make build-linux

# stage 2
FROM golang:1.15-alpine
FROM $GOLANG_BASE_IMAGE
LABEL maintainer="[email protected]"

# Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
Expand Down

0 comments on commit 84bc77c

Please sign in to comment.