您的位置 首页 docker

ubuntu 基础镜像

Ubuntu使用清华源( 镜像)步骤官方教程 帮助 :  连接

ubuntu 构建Docker镜像时处理'Configuring tzdata'交互输入 :  连接

ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

 

registry.cn-hangzhou.aliyuncs.com/kattgatt-base/ubuntu20.4-aliyuan:v1.0

 

1-更新镜像源:

需要 mkdir config

cat > config/sources.list  <<'EOF'
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF

 

2- 编写 Dockerfile

FROM ubuntu:20.04
​
​
LABEL maintainer=baimeidashu


​
COPY config/sources.list /etc/apt/sources.list
​

其他镜像:

FROM registry.cn-hangzhou.aliyuncs.com/baimeidashu/ubuntu:20.04

MAINTAINER zhaozhiyong  "715740383@qq.com"
COPY config/sources.list /etc/apt/sources.list

RUN apt-get update

阿里云: cat build.sh


#!/bin/bash

imagename=ubuntu20.4-aliyuan:v1.
docker build -t registry.cn-hangzhou.aliyuncs.com/kattgatt-base/$imagename --no-cache -f Dockerfile . --progress=plain
docker push registry.cn-hangzhou.aliyuncs.com/kattgatt-base/$imagename

 

registry.cn-hangzhou.aliyuncs.com/kattgatt-base/ubuntu20.4-aliyuan:v1.0

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章