-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (27 loc) · 874 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM alpine:latest
MAINTAINER Maximilian Pachl <m@ximilian.info>
# configuration and versions
ENV BUILD_TOOLS="go git musl-dev"
ENV GOPATH=/tmp/go
ADD . /tmp/go/src/github.com/faryon93/sackci
# compile and install sackci
RUN cd /tmp/go/src/github.com/faryon93/sackci && \
rm -rf /var/cache/apk/* && \
apk add --no-cache $BUILD_TOOLS && \
go get -v github.com/faryon93/sackci && \
go build -v -ldflags "-X main.GIT_COMMIT=`git log --pretty=format:'%h' -n 1`" \
-o /tmp/go/bin/sackci \
github.com/faryon93/sackci && \
go get github.com/tianon/gosu && \
cp /tmp/go/bin/sackci /usr/sbin/ && \
cp /tmp/go/bin/gosu /usr/bin && \
# remove build tools
rm -rf /tmp/go && \
apk del --purge $BUILD_TOOLS
# entry script
COPY entry.sh /
RUN chmod +x /entry.sh
RUN delgroup ping && \
adduser -D -u 1000 -g 'sackci' sackci
WORKDIR /sackci
ENTRYPOINT ["/entry.sh"]