Skip to content

Commit

Permalink
addl docker params/changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstanley committed Aug 10, 2020
1 parent 686023b commit 813f67d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.log
~*
*.tmp
*.txt
dist
*.test
*.prof
*.conf
*.toml
*.db
links
vendor
rice*.go
.git
bin
**/*.md
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@

# build image
FROM golang:latest as build
RUN mkdir /build
FROM golang:alpine as build
RUN apk add --no-cache g++ make
COPY . /build/
WORKDIR /build
RUN make

# runtime image
FROM alpine:latest

RUN apk add --no-cache ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/docker-library/golang/blob/1eb096131592bcbc90aa3b97471811c798a93573/1.14/alpine3.12/Dockerfile#L9
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

COPY --from=build /build/links /usr/local/bin/links

# runtime params
VOLUME /data
EXPOSE 80
WORKDIR /
Expand Down

0 comments on commit 813f67d

Please sign in to comment.