mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
Dockerfile now builds from golang:1.6-alpine
This commit is contained in:
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
||||
.dockerignore
|
||||
.goxc.json
|
||||
.goxc.local.json
|
||||
.travis.yml
|
||||
inbucket
|
||||
inbucket.exe
|
||||
swaks-tests
|
||||
target
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user