創建Gogs的Dockerfile

#Base image
FROM centos
#MAINTAINER
MAINTAINER git
#Run
RUN adduser git -d /home/git
RUN yum update -y
RUN yum -y install git wget
RUN mkdir -p /home/git/local
WORKDIR /home/git/local
RUN wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
RUN tar -C /home/git/local -xzf go1.8.3.linux-amd64.tar.gz
#ENV
ENV GOROOT /home/git/local/go
ENV GOPATH /home/git/go
ENV PATH PATH:PATH:GOROOT/bin:$GOPATH/bin
ENV USER git
WORKDIR /home/git/local
RUN wget https://dl.gogs.io/0.11.29/linux_amd64.tar.gz
RUN tar -C /home/git/local -xzf linux_amd64.tar.gz
RUN go get -u github.com/gogits/gogs
WORKDIR /home/git/go/src/github.com/gogits/gogs
RUN go build
RUN chown -R git:git /home/git
USER git
CMD ["/home/git/go/src/github.com/gogits/gogs/gogs",“web”]
EXPOSE 3000

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章