一、总览
- 制作镜像支持编译SDN以及上传helm包和images
- docker in docker
- go version 1.8
- registry.company.net
- buildx
-
注册runner到gitlab
-
编写gitlab-ci.yml文件设置CI流水线
一、镜像构建源文件
- 目录树
大约 3 分钟
注册runner到gitlab
编写gitlab-ci.yml文件设置CI流水线
FROM centos:centos7
ENV GOROOT="/usr/local/go" \
GOPROXY="https://goproxy.cn,direct" \
GOINSECURE="gitlab.my-company.net" \
GOPRIVATE="*.corp.com,gitlab.my-company.net" \
GONOPROXY="gitlab.my-company.net" \
GONOSUMDB="gitlab.my-company.net" \
PATH="$PATH:/usr/local/go/bin" \
TZ="Asia/Shanghai"
# repo
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="$HOME/.cargo/bin:$PATH" && \
yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo && \
yum -y install wget && \
cd /home && wget https://go.dev/dl/go1.19.8.linux-arm64.tar.gz && \
tar -C /usr/local -xzf go1.19.8.linux-arm64.tar.gz && \
export PATH=$PATH:/usr/local/go/bin && source /etc/profile && \
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile > /etc/profile && \
source /etc/profile && \
yum install -y automake autoconf libtool make gcc gcc-c++ rsync git && \
cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone && \