From f9adced65e1f93305b2493424651c6d7efe305f8 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sat, 20 Oct 2018 12:30:04 -0700 Subject: [PATCH] docker: Update build to use Go 1.11+modules for #121 - Fix outdated params in docker-run.sh --- CHANGELOG.md | 3 +++ Dockerfile | 9 ++++----- etc/docker/docker-run.sh | 14 +++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2605f34..24b7a16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Use Go 1.11 modules for reproducible builds. - SMTP TLS support (thanks kingforaday.) +### Changed +- Docker build now uses Go 1.11 and Alpine 3.8 + ## [v2.0.0] - 2018-05-05 diff --git a/Dockerfile b/Dockerfile index 9a1e0b9..0bc28fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # Docker build file for Inbucket: https://www.inbucket.org/ # Build -FROM golang:1.10-alpine as builder +FROM golang:1.11-alpine3.8 as builder RUN apk add --no-cache --virtual .build-deps git make -WORKDIR /go/src/github.com/jhillyerd/inbucket +WORKDIR /build COPY . . ENV CGO_ENABLED 0 RUN make clean deps @@ -12,11 +12,10 @@ RUN go build -o inbucket \ -v ./cmd/inbucket # Run in minimal image -FROM alpine:3.7 -ENV SRC /go/src/github.com/jhillyerd/inbucket +FROM alpine:3.8 WORKDIR /opt/inbucket RUN mkdir bin defaults ui -COPY --from=builder $SRC/inbucket bin +COPY --from=builder /build/inbucket bin COPY etc/docker/defaults/greeting.html defaults COPY ui ui COPY etc/docker/defaults/start-inbucket.sh / diff --git a/etc/docker/docker-run.sh b/etc/docker/docker-run.sh index 442f2fe..26c020c 100755 --- a/etc/docker/docker-run.sh +++ b/etc/docker/docker-run.sh @@ -12,9 +12,9 @@ PORT_POP3=1100 # Volumes exposed on host: VOL_CONFIG="/tmp/inbucket/config" -VOL_DATA="/tmp/inbucket/data" +VOL_DATA="/tmp/inbucket/storage" -set -eo pipefail +set -e main() { local run_opts="" @@ -39,11 +39,11 @@ main() { done docker run $run_opts \ - -p $PORT_HTTP:10080 \ - -p $PORT_SMTP:10025 \ - -p $PORT_POP3:10110 \ - -v "$VOL_CONFIG:/con/configuration" \ - -v "$VOL_DATA:/con/data" \ + -p $PORT_HTTP:9000 \ + -p $PORT_SMTP:2500 \ + -p $PORT_POP3:1100 \ + -v "$VOL_CONFIG:/config" \ + -v "$VOL_DATA:/storage" \ "$IMAGE" }