tencent cloud

文档反馈

镜像分层最佳实践

最后更新时间:2024-12-13 21:33:33

    操作场景

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

    容器镜像分层的优势

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

    前提条件

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

    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 Dockerfile-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 <container-id> | 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 Dockerfile-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 <container-id> | 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 <container-id> | 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 <container-id> | 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:80 f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-nginx:latest nginx -v
    # docker export <container-id> | docker import f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-nginx:latest
    # quick interative termnal: docker run -it --entrypoint=sh f3s-docker-file.tencentcloudcr.com/f3s-tcr/alpine-nginx:latest sh
    
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持