golang-centos的镜像

why

项目引用了github上的jieba分词golang版本,windows和centos都正常启动,但是ubantu等不能启动,总是提示缺少文件等错误
于是干脆重新制作一个centos的镜像解决问题

Dockerfile

FROM centos:7

Label author=xiaobowen 

RUN yum install -y gcc-c++
# WORKDIR
WORKDIR /go
#env
ENV PATH /usr/local/go/bin:$PATH
ENV GOROOT /usr/local/go
ENV GOPATH /home/go

RUN yum -y install wget \
    && mkdir /home/go \
    && wget https://studygolang.com/dl/golang/go1.13.10.linux-amd64.tar.gz \
    && tar -C /usr/local -zxf go1.13.10.linux-amd64.tar.gz

RUN echo export GOROOT=/usr/local/go >> /etc/profile
RUN echo export GOPATH=/home/go >> /etc/profile
RUN echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
RUN rm -f go1.13.10.linux-amd64.tar.gz
RUN source /etc/profile && go version
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo 'Asia/Shanghai' >/etc/timezone

你可能感兴趣的:(对于Go的学习)