-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
44 lines (32 loc) · 1.25 KB
/
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
36
37
38
39
40
41
42
43
44
# docker build -t mgrast/shock .
# docker run --rm --name test -ti mgrast/shock /bin/ash
# Note the setcap Linux command will only succeed if run as root.
# This allows the shock-server to bind to port 80 if desired.
#setcap 'cap_net_bind_service=+ep' bin/shock-server
FROM golang:alpine
ENV PYTHONUNBUFFERED=1
RUN apk update && apk add git curl &&\
echo "**** install Python ****" && \
apk add --no-cache python3 && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
echo "**** install pip ****" && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --no-cache --upgrade pip setuptools wheel && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi &&\
pip3 install boto3
ENV DIR=/go/src/github.com/MG-RAST/Shock
WORKDIR /go/bin
COPY . /go/src/github.com/MG-RAST/Shock
RUN mkdir -p /var/log/shock /usr/local/shock/data ${DIR}
# set version
#RUN cd ${DIR} && \
# VERSION=$(cat VERSION) && \
# sed -i "s/\[% VERSION %\]/${VERSION}/" shock-server/conf/conf.go
# compile
RUN cd ${DIR} && \
go get github.com/MG-RAST/go-shock-client &&\
./compile-server.sh
RUN mkdir -p /etc/shock.d/ ; touch /etc/shock.d/shock-server.conf
CMD ["/go/bin/shock-server"]