docker建立beego映象

爺來辣發表於2020-11-18

先在資料夾下載golang安裝包

wget https://dl.google.com/go/go1.13.9.linux-amd64.tar.gz

建立Dockerfile檔案 內容如下

FROM registry.cn-hangzhou.aliyuncs.com/xjm_public/centos:7.4.1708

MAINTAINER jiaminxu

ADD go1.13.9.linux-amd64.tar.gz  /usr/local/


ENV GO111MODULE=on
ENV GOROOT=/usr/local/go
ENV GOPATH=/home/gopath
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ENV GOPROXY=https://goproxy.io

RUN go get -u -v github.com/astaxie/beego
RUN go get -u -v github.com/beego/bee

build映象

docker build -t registry.cn-shanghai.aliyuncs.com/yjk-datag/beego:02  .

執行映象測試

 docker run -it  --rm  registry.cn-shanghai.aliyuncs.com/yjk-datag/beego:02 /bin/bash

檢視映象大小

相關文章