Update Dockerfile to go1.18 syntax

As of 1.18, `go get <package>` no longer builds executables. `go install` should be used to install an executable instead.
See the deprecation message for more information: https://go.dev/doc/go-get-install-deprecation

Pinning to a specific go Docker image will help keep things from breaking unexpectedly in the future
This commit is contained in:
Krista LaFentres (she/her) 2022-03-17 14:15:45 -05:00 committed by GitHub
parent 4231f068f1
commit 6fcf01a4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,14 +2,14 @@
# MailHog Dockerfile # MailHog Dockerfile
# #
FROM golang:alpine as builder FROM golang:1.18-alpine as builder
# Install MailHog: # Install MailHog:
RUN apk --no-cache add --virtual build-dependencies \ RUN apk --no-cache add --virtual build-dependencies \
git \ git \
&& mkdir -p /root/gocode \ && mkdir -p /root/gocode \
&& export GOPATH=/root/gocode \ && export GOPATH=/root/gocode \
&& go get github.com/mailhog/MailHog && go install github.com/mailhog/MailHog@latest
FROM alpine:3 FROM alpine:3
# Add mailhog user/group with uid/gid 1000. # Add mailhog user/group with uid/gid 1000.