diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2e74e0c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.dockerignore +.goxc.json +.goxc.local.json +.travis.yml +inbucket +inbucket.exe +swaks-tests +target diff --git a/Dockerfile b/Dockerfile index 507e9a1..dd3d338 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ # Docker build file for Inbucket, see https://www.docker.io/ # Inbucket website: http://www.inbucket.org/ -FROM golang:1.5 +FROM golang:1.6-alpine MAINTAINER James Hillyerd, @jameshillyerd +# Dependencies +RUN apk update && apk add git + # Configuration (WORKDIR doesn't support env vars) ENV INBUCKET_SRC $GOPATH/src/github.com/jhillyerd/inbucket ENV INBUCKET_HOME /opt/inbucket diff --git a/etc/docker/install.sh b/etc/docker/install.sh index 6e0b804..d5887ab 100755 --- a/etc/docker/install.sh +++ b/etc/docker/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # install.sh # description: Build, test, and install Inbucket. Should be executed inside a Docker container. @@ -10,23 +10,23 @@ bindir="$installdir/bin" # Setup export GOBIN="$bindir" -builddate="$(date --iso-8601=seconds)" +builddate="$(date -Iseconds)" cd "$srcdir" go clean # Build echo "### Fetching Dependencies" -go get -d -v ./... -go get -v github.com/stretchr/testify +go get -d -t -v ./... echo "### Testing Inbucket" go test ./... echo "### Building Inbucket" -mkdir -p "$bindir" -go build -o inbucket -race -ldflags "-X 'main.BUILD_DATE=$builddate'" -v . +go build -o inbucket -ldflags "-X 'main.BUILDDATE=$builddate'" -v . echo "### Installing Inbucket" +mkdir -p "$bindir" +mkdir -p "/etc/opt" mv inbucket "$bindir" install etc/docker/inbucket.conf /etc/opt/inbucket.conf install etc/docker/greeting.html /etc/opt/inbucket-greeting.html