Skip to content

Commit

Permalink
Merge pull request #49 from seatgeek/use-go-mod
Browse files Browse the repository at this point in the history
Upgrade to Go 1.13.7 and use go mod
  • Loading branch information
jippi committed Feb 7, 2020
2 parents 02c94ab + e56354a commit 39fef2f
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 586 deletions.
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
vendor/
!vendor/vendor.json
conf.d/
# Files
.gitignore
ci.sh
LICENSE
Makefile
README.md

# Folders
.git/
build/
conf.d/
examples/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
language: go

go:
- "1.11"
- "1.13.7"

services:
- docker
Expand All @@ -14,6 +14,7 @@ cache:

env:
global:
- DOCKER_BUILDKIT=1
- CGO_ENABLED=0
- GOBUILD="linux-amd64 windows-amd64 darwin-amd64"
# DOCKER_USER
Expand Down
35 changes: 29 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
FROM ubuntu:trusty
#
# Build Go binaries
#
FROM golang:1.13.7 as builder

RUN apt-get update \
&& apt-get install -y ssl-cert ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Define the build path
WORKDIR /root/go/src/github.com/seatgeek/hashi-helper

COPY build/hashi-helper-linux-amd64 /hashi-helper
# Disable CGO
ENV CGO_ENABLED=0

# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

# Copy the source from the current directory to the Working Directory inside the container
COPY . .

# Build the Go app
RUN go build -o /bin/hashi-helper

#
# Runtime container
#
FROM ubuntu:bionic

# Copy the binary from builder
COPY --from=builder /bin/hashi-helper /hashi-helper

# Configure entrypoint
ENTRYPOINT ["/hashi-helper"]
Loading

0 comments on commit 39fef2f

Please sign in to comment.