Skip to content

Commit

Permalink
makefile & dockerfile change to improve build efficiency
Browse files Browse the repository at this point in the history
Signed-off-by: Min Min <[email protected]>
  • Loading branch information
Min Min committed Jan 25, 2022
1 parent c55222f commit 4e19d9d
Show file tree
Hide file tree
Showing 42 changed files with 315 additions and 281 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
!/go.sum
!/resource-server-nginx.conf
!/version
!/docker
83 changes: 54 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,90 +4,115 @@
IMAGE_REPOSITORY = ccr.ccs.tencentyun.com/koderover-rc
VERSION ?= $(shell date +'%Y%m%d%H%M%S')
VERSION := $(VERSION)
TARGETS = aslan cron hub-agent hub-server jenkins-plugin podexec predator-plugin packager-plugin resource-server ua warpdrive policy user picket config init
TARGETS = aslan config cron hub-agent hub-server init jenkins-plugin packager-plugin picket podexec policy predator-plugin ua user warpdrive
REAPER_OS= focal xenial bionic

ALL_IMAGES=$(TARGETS:=.image)
ALL_PUSH=$(TARGETS:=.push)
ALL_REAPER=$(REAPER_OS:=.reaper.image)
ALL_REAPER_PUSH=$(REAPER_OS:=.reaper.push)

all: $(ALL_IMAGES:=.amd64) $(ALL_IMAGES:=.arm64) $(ALL_REAPER:=.amd64) $(ALL_REAPER:=.arm64)
all.push: $(ALL_PUSH:=.amd64) $(ALL_PUSH:=.arm64) $(ALL_REAPER_PUSH:=.amd64) $(ALL_REAPER_PUSH:=.arm64)
all: $(ALL_IMAGES:=.amd64) $(ALL_IMAGES:=.arm64) $(ALL_REAPER:=.amd64) $(ALL_REAPER:=.arm64) resource-server.build.amd64 resource-server.build.arm64
all.push: $(ALL_PUSH:=.amd64) $(ALL_PUSH:=.arm64) $(ALL_REAPER_PUSH:=.amd64) $(ALL_REAPER_PUSH:=.arm64) resource-server.upload.amd64 resource-server.upload.arm64

all.amd64: $(ALL_IMAGES:=.amd64) $(ALL_REAPER:=.amd64)
all.arm64: $(ALL_IMAGES:=.amd64) $(ALL_REAPER:=.arm64)
allpush.amd64: $(ALL_PUSH:=.amd64) $(ALL_REAPER_PUSH:=.amd64)
allpush.arm64: $(ALL_PUSH:=.arm64) $(ALL_REAPER_PUSH:=.arm64)
all.amd64: $(ALL_IMAGES:=.amd64) $(ALL_REAPER:=.amd64) resource-server.build.amd64
all.arm64: $(ALL_IMAGES:=.amd64) $(ALL_REAPER:=.arm64) resource-server.build.arm64
allpush.amd64: $(ALL_PUSH:=.amd64) $(ALL_REAPER_PUSH:=.amd64) resource-server.upload.amd64
allpush.arm64: $(ALL_PUSH:=.arm64) $(ALL_REAPER_PUSH:=.arm64) resource-server.upload.arm64

%.reaper.push.arm64: MAKE_IMAGE = ${IMAGE_REPOSITORY}/reaper-plugin:${VERSION}-arm64-$*
%.reaper.push.arm64: %.reaper.image.arm64
@docker push ${MAKE_IMAGE}

%.reaper.image.arm64: MAKE_IMAGE = ${IMAGE_REPOSITORY}/reaper-plugin:${VERSION}-arm64-$*
%.reaper.image.arm64: export GOOS = linux
%.reaper.image.arm64: export GOARCH = arm64
%.reaper.image.arm64:
@mkdir -p docker/dist/arm64
@go build -v -o docker/dist/reaper cmd/reaper/main.go
@cp docker/service/reaper-plugin-$*.Dockerfile docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#golang.Dockerfile/ {' -e 'r docker/base/arm64/golang.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-focal.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-focal.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-bionic.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-bionic.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/arm64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/arm64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#alpine-git.Dockerfile/ {' -e 'r docker/base/arm64/alpine-git.Dockerfile' -e 'd' -e '}' docker/dist/arm64/reaper-plugin-$*.Dockerfile
@docker build -f docker/dist/arm64/reaper-plugin-$*.Dockerfile --tag ${MAKE_IMAGE} .

%.reaper.push.amd64: MAKE_IMAGE = ${IMAGE_REPOSITORY}/reaper-plugin:${VERSION}-amd64-$*
%.reaper.push.amd64: %.reaper.image.amd64
@docker push ${MAKE_IMAGE}

%.reaper.image.amd64: MAKE_IMAGE = ${IMAGE_REPOSITORY}/reaper-plugin:${VERSION}-amd64-$*
%.reaper.image.amd64: export GOOS = linux
%.reaper.image.amd64: export GOARCH = arm64
%.reaper.image.amd64:
@mkdir -p docker/dist/amd64
@go build -v -o docker/dist/reaper cmd/reaper/main.go
@cp docker/service/reaper-plugin-$*.Dockerfile docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#golang.Dockerfile/ {' -e 'r docker/base/amd64/golang.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-focal.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-focal.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#ubuntu-bionic.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-bionic.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/amd64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/amd64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@sed -i -e '/#alpine-git.Dockerfile/ {' -e 'r docker/base/amd64/alpine-git.Dockerfile' -e 'd' -e '}' docker/dist/amd64/reaper-plugin-$*.Dockerfile
@docker build --progress=plain --no-cache -f docker/dist/amd64/reaper-plugin-$*.Dockerfile --tag ${MAKE_IMAGE} .
@docker build -f docker/dist/amd64/reaper-plugin-$*.Dockerfile --tag ${MAKE_IMAGE} .

%.push.amd64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/$*:${VERSION}-amd64
%.push.amd64: %.image.amd64
docker push ${MAKE_IMAGE}
@docker push ${MAKE_IMAGE}

%.image.amd64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/$*:${VERSION}-amd64
%.image.amd64: export GOOS = linux
%.image.amd64: export GOARCH = amd64
%.image.amd64:
@mkdir -p docker/dist/amd64
@cp docker/service/$*.Dockerfile docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#golang.Dockerfile/ {' -e 'r docker/base/amd64/golang.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#ubuntu-bionic.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-bionic.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#ubuntu-focal.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-focal.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/amd64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/amd64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#alpine-git.Dockerfile/ {' -e 'r docker/base/amd64/alpine-git.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/amd64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@go build -v -o docker/dist/$* cmd/$*/main.go
@docker build -f docker/dist/amd64/$*.Dockerfile --tag ${MAKE_IMAGE} .

%.push.arm64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/$*:${VERSION}-amd64
%.push.arm64: %.image.amd64
docker push ${MAKE_IMAGE}

%.image.arm64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/$*:${VERSION}-arm64
%.image.arm64: export GOOS = linux
%.image.arm64: export GOARCH = arm64
%.image.arm64:
@mkdir -p docker/dist/arm64
@cp docker/service/$*.Dockerfile docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#golang.Dockerfile/ {' -e 'r docker/base/arm64/golang.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#ubuntu-focal.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-focal.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#ubuntu-bionic.Dockerfile/ {' -e 'r docker/base/arm64/ubuntu-bionic.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/arm64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/arm64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#alpine-git.Dockerfile/ {' -e 'r docker/base/arm64/alpine-git.Dockerfile' -e 'd' -e '}' docker/dist/arm64/$*.Dockerfile
@sed -i -e '/#alpine.Dockerfile/ {' -e 'r docker/base/amd64/alpine.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@sed -i -e '/#ubuntu-xenial.Dockerfile/ {' -e 'r docker/base/amd64/ubuntu-xenial.Dockerfile' -e 'd' -e '}' docker/dist/amd64/$*.Dockerfile
@go build -v -o docker/dist/$* cmd/$*/main.go
@docker build -f docker/dist/arm64/$*.Dockerfile --tag ${MAKE_IMAGE} .

# USING BUILD AND UPLOAD INSTEAD OF IMAGE AND PUSH TO AVOID COLLISION
resource-server.build.amd64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/resource-server:${VERSION}-amd64
resource-server.build.amd64: export GOOS = linux
resource-server.build.amd64: export GOARCH = amd64
resource-server.build.amd64:
@mkdir -p docker/dist/amd64
@cp docker/service/resource-server.Dockerfile docker/dist/amd64/resource-server.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/amd64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/amd64/resource-server.Dockerfile
@go build -v -o docker/dist/reaper cmd/reaper/main.go
@docker build -f docker/dist/amd64/resource-server.Dockerfile --tag ${MAKE_IMAGE} .

resource-server.upload.amd64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/resource-server:${VERSION}-amd64
resource-server.upload.amd64: resource-server.build.amd64
@docker push ${MAKE_IMAGE}

resource-server.build.arm64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/resource-server:${VERSION}-arm64
resource-server.build.arm64: export GOOS = linux
resource-server.build.arm64: export GOARCH = arm64
resource-server.build.arm64:
@mkdir -p docker/dist/arm64
@cp docker/service/resource-server.Dockerfile docker/dist/arm64/resource-server.Dockerfile
@sed -i -e '/#nginx.Dockerfile/ {' -e 'r docker/base/arm64/nginx.Dockerfile' -e 'd' -e '}' docker/dist/arm64/resource-server.Dockerfile
@go build -v -o docker/dist/reaper cmd/reaper/main.go
@docker build -f docker/dist/arm64/resource-server.Dockerfile --tag ${MAKE_IMAGE} .

resource-server.upload.arm64: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/resource-server:${VERSION}-arm64
resource-server.upload.arm64: resource-server.build.arm64
@docker push ${MAKE_IMAGE}

.PHONY: clean
clean:
@rm -rf docker/dist
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docker/base/amd64/ubuntu-bionic.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ubuntu:bionic
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:bionic-amd64
2 changes: 1 addition & 1 deletion docker/base/amd64/ubuntu-focal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ubuntu:focal
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:focal-amd64
17 changes: 1 addition & 16 deletions docker/base/amd64/ubuntu-xenial.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
FROM ubuntu:xenial

# 修改镜像源和时区
RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list \
&& apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates \
&& apt-get install -y \
tzdata \
net-tools \
dnsutils \
ca-certificates \
git \
curl \
lsof \
telnet \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& rm -rf /var/lib/apt/lists/*
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:xenial-amd64
2 changes: 1 addition & 1 deletion docker/base/arm64/ubuntu-bionic.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM arm64v8/ubuntu:bionic
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:bionic-arm64
2 changes: 1 addition & 1 deletion docker/base/arm64/ubuntu-focal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM arm64v8/ubuntu:focal
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:focal-arm64
16 changes: 1 addition & 15 deletions docker/base/arm64/ubuntu-xenial.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
FROM arm64v8/ubuntu:xenial
FROM ccr.ccs.tencentyun.com/koderover-public/build-base:xenial-arm64

# 修改镜像源和时区
RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list \
&& apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates \
&& apt-get install -y \
tzdata \
net-tools \
dnsutils \
ca-certificates \
git \
curl \
lsof \
telnet \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& rm -rf /var/lib/apt/lists/*
31 changes: 31 additions & 0 deletions docker/base/image/bionic-base-amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:bionic

RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN apt-get install -y \
curl \
git \
netcat-openbsd \
wget \
build-essential \
libfontconfig \
libsasl2-dev \
libfreetype6-dev \
libpcre3-dev \
pkg-config \
cmake \
python \
librrd-dev \
sudo

# 修改时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 安装 docker client
RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
tar -xvzf docker.tgz &&\
mv docker/* /usr/local/bin

# 替换tar(适配cephfs)
RUN rm /bin/tar && curl -fsSL http://resource.koderover.com/tar -o /bin/tar && chmod +x /bin/tar
31 changes: 31 additions & 0 deletions docker/base/image/bionic-base-arm64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM arm64v8/ubuntu:bionic

RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN apt-get install -y \
curl \
git \
netcat-openbsd \
wget \
build-essential \
libfontconfig \
libsasl2-dev \
libfreetype6-dev \
libpcre3-dev \
pkg-config \
cmake \
python \
librrd-dev \
sudo

# 修改时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 安装 docker client
RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
tar -xvzf docker.tgz &&\
mv docker/* /usr/local/bin

# 替换tar(适配cephfs)
RUN rm /bin/tar && curl -fsSL http://resource.koderover.com/tar -o /bin/tar && chmod +x /bin/tar
31 changes: 31 additions & 0 deletions docker/base/image/focal-base-amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:focal

RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN apt-get install -y \
curl \
git \
netcat-openbsd \
wget \
build-essential \
libfontconfig \
libsasl2-dev \
libfreetype6-dev \
libpcre3-dev \
pkg-config \
cmake \
python \
librrd-dev \
sudo

# 修改时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 安装 docker client
RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
tar -xvzf docker.tgz &&\
mv docker/* /usr/local/bin

# 替换tar(适配cephfs)
RUN rm /bin/tar && curl -fsSL http://resource.koderover.com/tar -o /bin/tar && chmod +x /bin/tar
31 changes: 31 additions & 0 deletions docker/base/image/focal-base-arm64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM arm64v8/ubuntu:focal

RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN apt-get install -y \
curl \
git \
netcat-openbsd \
wget \
build-essential \
libfontconfig \
libsasl2-dev \
libfreetype6-dev \
libpcre3-dev \
pkg-config \
cmake \
python \
librrd-dev \
sudo

# 修改时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 安装 docker client
RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
tar -xvzf docker.tgz &&\
mv docker/* /usr/local/bin

# 替换tar(适配cephfs)
RUN rm /bin/tar && curl -fsSL http://resource.koderover.com/tar -o /bin/tar && chmod +x /bin/tar
53 changes: 53 additions & 0 deletions docker/base/image/xenial-base-amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu:xenial

RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
RUN apt-get clean && apt-get update && apt-get install -y \
curl \
netcat-openbsd \
wget \
build-essential \
libfontconfig \
libsasl2-dev \
libfreetype6-dev \
libpcre3-dev \
pkg-config \
cmake \
python \
librrd-dev \
python \
net-tools \
dnsutils \
ca-certificates \
lsof \
telnet \
sudo

# Upgrade Git to latest version,forcing IPv4 transport with apt-get
RUN echo "deb http://launchpad.proxy.ustclug.org/git-core/ppa/ubuntu xenial main" >> /etc/apt/sources.list

# Using 'launchpad.proxy.ustclug.org' to reverse proxy for 'launchpad.net'. Detail:https://lug.ustc.edu.cn/wiki/mirrors/help/revproxy/
RUN echo "deb-src http://launchpad.proxy.ustclug.org/git-core/ppa/ubuntu xenial main" >> /etc/apt/sources.list

# Import key manually to solve bad network problems
RUN echo '-----BEGIN PGP PUBLIC KEY BLOCK----- \nVersion: \nComment: Hostname: keyserver.ubuntu.com \n \nxo0ESXjaGwEEAMA26F3+mnRW8uRqASMsEa5EsmgvUpLD7EKpC7903OpiMGSvZ2sE \n34g7W6nUQY0R//AZS2iW4ZXfvdhQTQuuPlHM6Q3iUAt+nyXcf9xBlscs8Gm722u4 \njAtFtBS4BMQRhRRfWTHwJIOM6OpGIccjPe8pQfIeoRxkKJxlehzw2mU1ABEBAAHN \nKExhdW5jaHBhZCBQUEEgZm9yIFVidW50dSBHaXQgTWFpbnRhaW5lcnPCtgQTAQIA \nIAUCSXjaGwIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEKFxXYjh3x8k/zMD \n/RKBMjavvFl71YBazSOGl2YfSsZiR/ANsby3+rUaULb8uxzCHXAQnlH5vdtLSPry \naLBvzCU8C3C02qNT8jRacU2752zsCkCi1SLRSOXdI/ATJHza5aTvYV93rTITBhU4 \nsJQeK9RW0CtaDRAxJsn/Dr6J3lL/c9m9cT5fFpxOIsF4 \n=7kFR \n-----END PGP PUBLIC KEY BLOCK----- \n' > key

RUN apt-key add key

# Forcing IPv4 transport with apt-get
RUN apt-get -o Acquire::ForceIPv4=true update

RUN apt-get -o Acquire::ForceIPv4=true install -y git

# Change timezone to Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# Install docker client
RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
tar -xvzf docker.tgz &&\
mv docker/* /usr/local/bin


# Replaces the default tar(for cephfs)
RUN rm /bin/tar && curl -fsSL http://resource.koderover.com/tar -o /bin/tar && chmod +x /bin/tar
Loading

0 comments on commit 4e19d9d

Please sign in to comment.