-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile
31 lines (24 loc) · 992 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
FROM debian:buster
MAINTAINER Lei Xue <[email protected]>
# setup golang environment
ENV GOLANG_VERSION 1.14.4
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067
RUN apt-get update && apt-get install -y curl automake gcc make libcephfs-dev librbd-dev librados-dev
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
RUN mkdir -p /go/src/github.com/gostor/gotgt
ADD . /go/src/github.com/gostor/gotgt
WORKDIR ${GOPATH}/src/github.com/gostor/gotgt
RUN make
EXPOSE 23457
EXPOSE 3260
CMD ["./gotgt", "daemon"]
RUN apt-get purge -y curl automake gcc make
RUN apt-get autoremove -y