Skip to content

Commit

Permalink
Configure non-privileged user, update to Go 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Sep 12, 2017
1 parent 25c7c50 commit b65b9bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
FROM golang:1.7
FROM golang:1.9

COPY cmd/freegeoip/public /var/www

ADD . /go/src/github.com/fiorix/freegeoip
RUN cd /go/src/github.com/fiorix/freegeoip/cmd/freegeoip && go get && go install
RUN \
cd /go/src/github.com/fiorix/freegeoip/cmd/freegeoip && \
go get -d && go install && \
apt-get update && apt-get install -y libcap2-bin && \
setcap cap_net_bind_service=+ep /go/bin/freegeoip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
useradd -ms /bin/bash freegeoip

USER freegeoip
ENTRYPOINT ["/go/bin/freegeoip"]

EXPOSE 8080
Expand Down

0 comments on commit b65b9bf

Please sign in to comment.