上云无忧 > 文档中心 > 腾讯云容器服务实战教程 - 境外镜像拉取加速
容器服务 TKE
腾讯云容器服务实战教程 - 境外镜像拉取加速

文档简介:
操作场景: 本文介绍如何把业务镜像分层构建与管理,使用 TCR 高效的管理各类容器镜像的最佳实践。
*此产品及展示信息均由腾讯云官方提供。免费试用 咨询热线:400-826-7010,为您提供专业的售前咨询,让您快速了解云产品,助您轻松上云! 微信咨询
  免费试用、价格特惠

操作场景

本文介绍如何把业务镜像分层构建与管理,使用 TCR 高效的管理各类容器镜像的最佳实践。

容器镜像分层的优势

共享资源,提升资源利用率。
镜像管理规范化与标准化,便于 Devops 落地实施。
TCR 的免运维、镜像加速,可轻松提升大规模镜像分发速度 5-10 倍。
TCR 企业版内实例、命名空间、镜像仓库等资源的读写操作已接入操作审计,通过控制台进入审计日志即可查看相关操作记录。

前提条件

在使用 TCR 内托管的私有镜像进行应用部署前,您需要完成以下准备工作:
已在 容器镜像服务 创建企业版实例。如尚未创建,请参考 创建企业版实例 完成创建。
如果使用子账号进行操作,请参考 企业版授权方案示例 提前为子账号授予对应实例的操作权限。
说明:
已有容器镜像服务也适用,修改镜像仓库地址即可。

1. F3S Docker Files 介绍

项目由以下部分组成:
		
		
$ tree -L 3 ./f3s-docker-files
./f3s-docker-files
├── README.md ------ 说明文件
├── DockerBuildImages.sh ------ 镜像构建脚本
├── 0.base ------ 0. 构建 Base 层各类系统镜像
│ ├── alpine ------ 构建 Base 层 alpine 系统镜像
│ │ └── Dockerfile
│ └── centos-7.8 ------ 构建 Base 层 Centos7.8 系统镜像
│ ├── Dockerfile
│ └── centos-7.8.2003-x86_64-docker.tar.xz
├─ 1.ops ------ 1. 构建运维层各类镜像
│ └── Dockerfile-alpine ------ 构建运维层 alpine 镜像
├── 2.lang ------ 2. 构建语言层各类镜像
│ └── Dockerfile-alpine-kona ------ 语言层 alpine-kona 镜像
└── 3.app ------ 3. 构建应用层各类镜像
├── jmeter
│ ├── Dockerfile-jmeter-base ------ 构建 jmeter-base 镜像
│ ├── Dockerfile-jmeter-grafana-reporter ------ 构建 jmeter-grafana-reporter 镜像
│ ├── Dockerfile-jmeter-master ------ 构建 jmeter-master 镜像
│ └── Dockerfile-jmeter-slave ------ 构建 jmeter-slave 镜像
├── nginx
│ ├── Dockerfile-alpine-nginx ------ 构建 alpine-nginx 镜像
│ ├── default.conf
│ └── nginx.conf
└── skywalking
└── Dockerfile-alpine-kona-skywalking ------ 构建 alpine-kona-skywalking 镜像
alpine/Dockerfile :使用 alpine 官方提供的 3.13 docker 镜像 构建,添加常用运维工具与中文支持等配置。
centos-7.8/Dockerfile :使用 Centos 官方提供的 7.8 docker 镜像 构建,添加常用运维工具与中文支持等配置。
Dockerfile-alpine-kona :使用 Dockerfile-alpine 和 TencentKona 8.0.5 二进制包 构建,为控制镜像大小对 Kona 做了部分裁剪。
Dockerfile-jmeter-base :基于 Jmeter 官方提供的 5.4.1 二进制包 构建。
Dockerfile-jmeter-grafana-reporter :基于 Grafana-Reporter 构建 ,提供 Grafana 仪表板生成 Jmeter PDF 报告的功能。
Dockerfile-jmeter-master :基于 Jmeter-base 镜像构建,实现 Jmeter 分布式压测 Master 的功能。
Dockerfile-jmeter-slave :基于 Jmeter-base 镜像构建,实现 Jmeter 分布式压测 Slave 的功能。
Dockerfile-alpine-nginx :基于 Dockerfile-alpine 构建 ,添加 nginx 配置初始化与日志规范等配置。
Dockerfile-alpine-kona-skywalking :使用 Dockerfile-alpine-kona 和 skywalking 官方提供的 8.5 二进制包 构建。

2. 项目资源说明

2.0 Dockerfile-alpine

============ALPINE DOCKER FILE============
		
		
# build
FROM alpine:3.13
ENV FROM alpine:3.13
# Alpine 镜像中并没有包含 tzdata,所以无法直接通过环境变量 TZ 设置时区,因此需要安装 tzdata:
ENV TZ=Asia/Shanghai
RUN echo 'http://mirrors.tencent.com/alpine/v3.13/main/' > /etc/apk/repositories \
&& echo 'http://mirrors.tencent.com/alpine/v3.13/community/' >> /etc/apk/repositories \
&& apk --no-cache add apache2-utils \
bind-tools \
bridge-utils \
busybox-extras \
curl \
ebtables \
ethtool \
fio \
fping \
iperf3 \
iproute2 \
iptables \
iputils \
ipvsadm \
jq \
lftp \
lsof \
mtr \
netcat-openbsd \
net-tools \
nmap \
procps \
psmisc \
rsync \
smartmontools \
strace \
sysstat \
tcpdump \
tree \
tzdata \
unzip \
util-linux \
wget \
zip \
&& echo "${TZ}" > /etc/timezone \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& rm -rf /var/cache/apk/*
ENV BUILD f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:v3.13
# docker build -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:v3.13 .
============Build, tag and push the base image============
		
		
cd $pwd/0.base/alpine
docker build -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:v3.13 -f Dockerfile .
docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:v3.13

2.1 Dockerfi̇le-CentOS-7.8

============Centos-7.8 DOCKER FILE============



		
# build

# centos 7.8 官方 Dockerfile:https://github.com/CentOS/sig-cloud-instance

-images/blob/CentOS-7.8.2003-x86_64/docker/Dockerfile

# centos 7.8 官方包: wget https://raw.githubusercontent.com/CentOS

/sig-cloud-instance-images/CentOS-7.8.2003-x86_64/docker/centos-7.8.2003-x86_64-docker.tar.xz

FROM scratch
ADD centos-7.8.2003-x86_64-docker.tar.xz /
LABEL name="CentOS Base Image" \
vendor="CentOS" \
license="GPLv2" \
build-date="20200504"
# 增加一些小工具,并修改时区
RUN set -ex \
&& yum install -y wget \
&& rm -rf /etc/yum.repos.d/CentOS-* \
# 添加 Tencent yum 源
&& wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo \
&& yum fs filter documentation \
&& yum install -y atop \
bind-utils \
curl \
dstat \
ebtables \
ethtool \
fping \
htop \
iftop \
iproute \
jq \
less \
lsof \
mtr \
nc \
net-tools \
nmap-ncat \
perf \
psmisc \
strace \
sysstat \
tcpdump \
telnet \
tree \
unzip \
wget \
which \
zip \
ca-certificates \
&& rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
# Install dumb-init
&& wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 \
&& chmod +x /usr/local/bin/dumb-init \
# Install gosu grab gosu for easy step-down from root
# https://github.com/tianon/gosu/releases
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.13/gosu-amd64" \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
# 安装中文语言包,解决中文乱码问题,vi 乱码需要这里解决
&& yum -y install kde-l10n-Chinese glibc-common \
&& localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 \
&& export LC_ALL=zh_CN.utf8 \
&& yum clean all \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/yum/* \
&& rm -rf /var/cache/yum
# 解决 less 乱码问题
ENV LESSCHARSET utf-8
# 设置语言环境变量
ENV LANG=en_US.UTF-8
# 不加这句则 kubernetes 中的 stdin: true 和 tty: true 不生效
CMD ["/bin/bash"]
ENV BUILD f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8
# docker build -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8 .



============Build, tag and push the base image============
		
		
cd $pwd/0.base/centos-7.8
docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8 -f Dockerfile .
docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8
# To test run: docker run --name test -it --rm f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8 uname -a
# docker export| docker import f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8
# quick interative termnal: docker run -it --entrypoint=sh f3s-docker-file.tencentcloudcr.com/f3s-tcr/centos:v7.8 sh

2.2 Dockerfi̇le-Ops

============Ops DOCKER FILE============
		
		
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:v3.13
MAINTAINER westzhao
ENV LANG=C.UTF-8
# 下载运维工具
RUN apk --no-progress --purge --no-cache add --upgrade wget \
curl \
mysql-client \
busybox \
busybox-extras \
bash \
bash-doc \
bash-completion \
tzdata \
vim \
unzip && \
# 下载 glibc 支持 jdk、解决中文支持问题 && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-bin-2.33-r0.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-i18n-2.33-r0.apk && \
apk add glibc-2.33-r0.apk glibc-bin-2.33-r0.apk glibc-i18n-2.33-r0.apk && \
rm glibc-2.33-r0.apk glibc-bin-2.33-r0.apk glibc-i18n-2.33-r0.apk && \
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 C.UTF-8 && \
echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \
# 修改时区
mkdir -p /share/zoneinfo/Asia/ && \
mkdir -p /etc/zoneinfo/Asia/ && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
cp /usr/share/zoneinfo/Asia/Shanghai /share/zoneinfo/Asia/Shanghai && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/zoneinfo/Asia/Shanghai && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata && \
# 删除 apk 缓存 && \
rm -rf /var/cache/apk/*
============Build, tag and push the base image============
		
		
docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest -f ./1.ops/Dockerfile-alpine .
docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest
# To test run: docker run --name test -it --rm f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest sh $(java -version)
# docker export| docker import f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest
# quick interative termnal: docker run -it --entrypoint=sh f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest sh

2.3 Dockerfile-alpine-kona

============Alpine Kona DOCKER FILE============
		
		
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine:latest
MAINTAINER westzhao
ENV LANG=C.UTF-8
# 通过 wget 下载 Kona 安装包 && \
RUN cd /opt && \
wget https://github.com/Tencent/TencentKona-8/releases/download/8.0.5-GA/TencentKona8.0.5.b12_jdk_linux-x86_64_8u282.tar.gz && \
tar -xvf TencentKona8.0.5.b12_jdk_linux-x86_64_8u282.tar.gz && \
rm TencentKona8.0.5.b12_jdk_linux-x86_64_8u282.tar.gz && \
ln -nfs /opt/TencentKona-8.0.5-282 /opt/jdk && \
# 裁剪 jdk 未使用资源 && \
rm /opt/jdk/release && \
rm /opt/jdk/THIRD_PARTY_README && \
rm /opt/jdk/LICENSE && \
rm /opt/jdk/ASSEMBLY_EXCEPTION && \
rm -rf /opt/jdk/sample/ && \
rm -rf /opt/jdk/demo/ && \
rm -rf /opt/jdk/src.zip && \
rm -rf /opt/jdk/man/ && \
rm -rf /opt/jdk/lib/missioncontrol && \
rm -rf /opt/jdk/lib/visualvm && \
rm -rf /opt/jdk/lib/ant-javafx.jar && \
rm -rf /opt/jdk/lib/javafx-mx.jar && \
rm -rf /opt/jdk/lib/jconsole.jar && \
rm -rf /opt/jdk/jre/lib/amd64/libawt_xawt.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjavafx_font_freetype.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjavafx_font_pango.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjavafx_font.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjavafx_font_t2k.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjavafx_iio.so && \
rm -rf /opt/jdk/jre/lib/amd64/libjfxwebkit.so && \
rm -rf /opt/jdk/jre/lib/desktop && \
rm -rf /opt/jdk/jre/lib/ext/jfxrt.jar && \
rm -rf /opt/jdk/jre/lib/fonts && \
rm -rf /opt/jdk/jre/lib/locale/de && \
rm -rf /opt/jdk/jre/lib/locale/fr && \
rm -rf /opt/jdk/jre/lib/locale/it && \
rm -rf /opt/jdk/jre/lib/locale/ja && \
rm -rf /opt/jdk/jre/lib/locale/ko && \
rm -rf /opt/jdk/jre/lib/locale/ko.UTF-8 && \
rm -rf /opt/jdk/jre/lib/locale/pt_BR && \
rm -rf /opt/jdk/jre/lib/locale/sv && \
rm -rf /opt/jdk/jre/lib/locale/zh_HK.BIG5HK && \
rm -rf /opt/jdk/jre/lib/locale/zh_TW && \
rm -rf /opt/jdk/jre/lib/locale/zh_TW.BIG5 && \
rm -rf /opt/jdk/jre/lib/oblique-fonts && \
rm -rf /opt/jdk/jre/lib/deploy.jar && \
rm -rf /opt/jdk/jre/lib/locale/
# JAVA_HOME
ENV JAVA_HOME=/opt/jdk
ENV CLASSPATH=.:$JAVA_HOME/lib/
ENV PATH=$JAVA_HOME/bin:$PATH
============Build, tag and push the base image============
		
		
docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest -f ./2.lang/Dockerfile-alpine-kona .
docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest
# To test run: docker run --name test -it --rm f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest sh $(java -version)
# docker export| docker import f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest
# quick interative termnal: docker run -it --entrypoint=sh f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest sh

2.4 Dockerfile-alpine-kona-skywalking

============Alpine Kona SkyWalking DOCKER FILE============


		
	
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest
MAINTAINER westzhao
ENV LANG=C.UTF-8
# 下载运维工具
RUN mkdir /3.app && \

wget -q -O /3.app/apache-skywalking-apm-8.5.0.tar.gz https://archive.apache.

org/dist/skywalking/8.5.0/apache-skywalking-apm-8.5.0.tar.gz && \

tar zxf /3.app/apache-skywalking-apm-8.5.0.tar.gz -C /3.app && \
mv /3.app/apache-skywalking-apm-bin/agent /3.app/skywalking && \
rm -rf /3.app/apache-skywalking-apm-8.5.0.tar.gz && \
rm -rf /3.app/apache-skywalking-apm-bin/
# JAVA_HOME
ENV JAVA_HOME=/opt/jdk
ENV CLASSPATH=.:$JAVA_HOME/lib/
ENV PATH=$JAVA_HOME/bin:$PATH


============Build, tag and push the base image============



		

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/alpine-kona-skywalking:latest -f ./3.app/skywalking/Dockerfile-alpine-kona-skywalking .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona-skywalking:latest

# To test run: docker run --name test -it --rm f3s-docker-file.tencentcloudcr.com

/f3s-tcr/alpine-kona-skywalking:latest sh $(java -version)

# docker export| docker import f3s-docker-file.

tencentcloudcr.com/f3s-tcr/alpine-kona-skywalking:latest

# quick interative termnal: docker run -it --entrypoint=sh f3s-docker-file.

tencentcloudcr.com/f3s-tcr/alpine-kona-skywalking:latest sh



2.5 Dockerfile-jmeter-base

============JMETER BASE DOCKER FILE============


		
	
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest
MAINTAINER westzhao
ARG JMETER_VERSION=5.4.1
# 下载 jmeter
RUN mkdir /jmeter && \
cd /jmeter && \
wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz && \
tar -xzf apache-jmeter-$JMETER_VERSION.tgz && \
rm apache-jmeter-$JMETER_VERSION.tgz && \
# 下载 JMeterPlugins-Standard && \
cd /jmeter/apache-jmeter-$JMETER_VERSION/ && \
wget -q -O /tmp/JMeterPlugins-Standard-1.4.0.zip https://jmeter-plugins.org/downloads/file/JMeterPlugins-Standard-1.4.0.zip && \
unzip -n /tmp/JMeterPlugins-Standard-1.4.0.zip && \
rm /tmp/JMeterPlugins-Standard-1.4.0.zip && \
# 下载 pepper-box && \

wget -q -O /jmeter/apache-jmeter-$JMETER_VERSION/lib/ext/pepper-box-1.0.jar

https://github.com/raladev/load/blob/master/JARs/pepper-box-1.0.jar?raw=true && \

# 下载 bzm-parallel && \
cd /jmeter/apache-jmeter-$JMETER_VERSION/ && \
wget -q -O /tmp/bzm-parallel-0.7.zip https://jmeter-plugins.org/files/packages/bzm-parallel-0.7.zip && \
unzip -n /tmp/bzm-parallel-0.7.zip && \
rm /tmp/bzm-parallel-0.7.zip
ENV JMETER_HOME /jmeter/apache-jmeter-$JMETER_VERSION/
ENV PATH $JMETER_HOME/bin:$PATH


============Build, tag and push the base image============


		
	

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/jmeter-base:latest -f ./3.app/jmeter/Dockerfile-jmeter-base .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-base:latest


2.6 Dockerfile-jmeter-master

============JMETER-MASTER DOCKER FILE============
		
		
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-base:latest
MAINTAINER westzhao
EXPOSE 60000
============Build, tag and push the base image============


		
	

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/jmeter-master:latest -f ./3.app/jmeter/Dockerfile-jmeter-master .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-master:latest


2.7 Dockerfile-jmeter-slave

================JMETER-SLAVES DOCKER FILE=====================
		
		
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-base:latest
MAINTAINER westzhao
EXPOSE 1099 50000
ENTRYPOINT $JMETER_HOME/bin/jmeter-server \
-Dserver.rmi.localport=50000 \
-Dserver_port=1099 \
-Jserver.rmi.ssl.disable=true
============Build, tag and push the base image============


		
	

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/jmeter-slave:latest -f ./3.app/jmeter/Dockerfile-jmeter-slave .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-slave:latest


2.8 Dockerfile-jmeter-grafana-reporter

================JMETER-GRAFANA-REPORTER DOCKER FILE=====================
		
		
# build
# 多阶构建
FROM golang:1.14.7-alpine3.12 AS build
MAINTAINER westzhao
# 下载运维/编译工具
WORKDIR /go/src/${owner:-github.com/8710925}/reporter
# ADD . .
# RUN go install -v github.com/8710925/reporter/cmd/grafana-reporter
RUN apk --no-progress --purge --no-cache add --upgrade git && \
# 编译 grafana-reporter
git clone https://${owner:-github.com/8710925}/reporter . \
&& go install -v github.com/8710925/reporter/cmd/grafana-reporter
# create grafana reporter image
FROM alpine:3.12
COPY --from=build /go/src/${owner:-github.com/8710925}/reporter/util/texlive.profile /
COPY --from=build /go/src/${owner:-github.com/8710925}/reporter/util/SIMKAI.ttf /usr/share/fonts/west/
RUN apk --no-progress --purge --no-cache add --upgrade wget \
curl \
fontconfig \
unzip \
tzdata \
perl-switch && \
wget -qO- \
"https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | \
sh -s - --admin --no-path \
&& mv ~/.TinyTeX /opt/TinyTeX \
&& /opt/TinyTeX/bin/*/tlmgr path add \
&& tlmgr path add \
&& chown -R root:adm /opt/TinyTeX \
&& chmod -R g+w /opt/TinyTeX \
&& chmod -R g+wx /opt/TinyTeX/bin \
&& tlmgr update --self --repository http://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet \
&& tlmgr install epstopdf-pkg ctex everyshi everysel euenc \
# 修改时区
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata \
# Cleanup
&& fmtutil-sys --all \
&& texhash \
&& mktexlsr \
&& apk del --purge -qq \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /go/bin/grafana-reporter /usr/local/bin
ENTRYPOINT [ "/usr/local/bin/grafana-reporter","-ip","jmeter-grafana:3000" ]
============Build, tag and push the base image============


		
	

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/jmeter-grafana-reporter:latest -f ./3.app/jmeter/Dockerfile-jmeter-grafana-reporter .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/jmeter-grafana-reporter:latest


2.9 Dockerfile-alpine-nginx

================Alpine Nginx DOCKER FILE=====================
		
		
# build
FROM f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-kona:latest
MAINTAINER westzhao
ENV LANG=C.UTF-8
# 下载运维工具
RUN apk --no-progress --purge --no-cache add --upgrade nginx && \
# 删除 apk 缓存 && \
rm -rf /var/cache/apk/*
COPY ./3.app/nginx/default.conf /etc/nginx/http.d/default.conf
COPY ./3.app/nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 443
CMD ["/usr/sbin/nginx", "-g", "daemon off;", "-c", "/etc/nginx/nginx.conf"]
============Build, tag and push the base image============


		
	

docker build --no-cache -t f3s-docker-file.tencentcloudcr.com/f3s-tcr

/alpine-nginx:latest -f ./3.app/nginx/Dockerfile-alpine-nginx .

docker push f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-nginx:latest
# To test run: docker run --name test -it --rm -p 8888


相似文档
  • 操作场景: 本文章介绍了 SpringCloud 应用托管到腾讯云容器服务 TKE 的最佳实践。 SpringCloud 应用托管到 TKE 具有以下优势: 提升资源利用率。 Kubernetes 天然适合微服务架构。 提升运维效率,便于 Devops 落地实施。 Kubernetes 的高弹性,可轻松实现应用的动态扩缩容。
  • 背景: 公有云的发展为业务的稳定性、可拓展性、便利性带来了极大帮助。这种用租代替买、并且提供完善的技术支持和保障的服务,理应为业务带来降本增效的效果。但实际上业务上云并不意味着成本一定较少,还需适配云上业务的应用开发、架构设计、管理运维、合理使用等多方面解决方案,才能真正助力业务的降本增效。
  • 使用场景: IDC 的资源有限,当需要应对业务突发流量,IDC 内的算力资源不足以应对时,可以选择使用公有云资源应对临时流量。TKE Resilience Chart 利用 TKE Serverless 容器服务,基于自定义的调度策略,通过添加超级节点的方式,将用户集群中的工作负载弹性上云,使用户 IDC 集群获得极大的弹性拓展能力,优势如下: 1. 用户 IDC / 私有云的硬件和维护成本保持不变。 2. 实现了用户 IDC / 私有云和公有云级别的应用高可用。 3. 用户按需使用公有云的资源,按需付费。
  • 技术背景: Stable Diffusion 是一种深度学习的文本到图像模型,由 Runway 和慕尼黑大学合作构建,第一个版本于2021年发布。目前主流版本包含 v1.5、v2和v2.1。它主要用于生成基于文本描述的详细图像,也应用于其他任务,如修复图像、生成受文本提示引导的图像到图像的转换等。
  • 背景介绍: ChatGLM-6B 是一个开源的、支持中英双语的对话语言模型,基于 General Language Model (GLM) 架构,具有62亿参数。结合模型量化技术,用户可以在消费级的显卡上进行本地部署(INT4 量化级别下最低只需6GB显存)。
官方微信
联系客服
400-826-7010
7x24小时客服热线
分享
  • QQ好友
  • QQ空间
  • 微信
  • 微博
返回顶部