全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 388|回复: 0

alpine(Go环境)Docker基础镜像制作

[复制链接]
发表于 2023-11-3 21:46:57 | 显示全部楼层 |阅读模式
拉取官方alpine
  1. docker pull alpine:latest
复制代码

安装glibc
参考:https://github.com/sgerrand/alpine-pkg-glibc/

设置时区
  1. RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/main\n\
  2. https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/community" > /etc/apk/repositories
  3. # Install base packages
  4. RUN apk update && apk --no-cache add tzdata ca-certificates wget \
  5.     && cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
复制代码

制作基础镜像
Dockerfile
  1. FROM alpine:latest
  2. RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/main\n\
  3. https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/community" > /etc/apk/repositories
  4. # Install base packages
  5. RUN apk update && apk --no-cache add tzdata ca-certificates wget \
  6.     && cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  7. RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk  && apk add glibc-2.27-r0.apk && rm -f glibc-2.27-r0.apk /etc/apk/keys/sgerrand.rsa.pub
复制代码
  1. docker build -t hub.linuxeye.com/library/alpine:latest .   #生成镜像
  2. docker push hub.linuxeye.com/library/alpine:latest        #推送私有仓库
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-5 12:01 , Processed in 0.056031 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表