From fd52b81c519388e308fc76fc544b8ebd7d9ef1f9 Mon Sep 17 00:00:00 2001 From: Lei Xue Date: Tue, 29 Nov 2016 17:59:25 +0800 Subject: [PATCH] add Dockerfile --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ README.md | 1 - 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73ba8b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:jessie +MAINTAINER Lei Xue + +# setup golang environment +ENV GOLANG_VERSION 1.7.3 +ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz +ENV GOLANG_DOWNLOAD_SHA256 508028aac0654e993564b6e2014bf2d4a9751e3b286661b0b0040046cf18028e + +RUN apt-get update && apt-get install -y curl automake gcc make +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 ./autogen.sh +RUN ./configure +RUN make + +EXPOSE 23457 +EXPOSE 3260 +CMD ["./gotgt", "daemon"] + +RUN apt-get purge -y curl automake gcc make +RUN apt-get autoremove -y diff --git a/README.md b/README.md index bb69c6b..e450b46 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ You can test this with [open-iscsi](http://www.open-iscsi.com/) or [libiscsi](ht * Redirect iSCSI Target (orzhang, p2) * Homepage (p3) * More test cases (p2) -* Docker image (p3) * IDM implementation (p3) https://tools.ietf.org/html/rfc5047 ## Contributing