如何制作debian(mips64el) docker镜像并上传到docker官方仓库

系统环境:龙芯3A3000+Loongnix1.0

  1. 制作debian最小系统
    # debootstrap --arch mips64el buster debian10_mips64el http://mirrors.ustc.edu.cn/debian

  2. 导入docker

### 此处用loongsongd 是为了上传到hub.docker.com。 loongsongd 是在hub.docker 上注册的用户名 
# tar -C debian10_mips64el/ -c . | docker import - loongsongd/debian:v10
sha256:89b502980b393daf52301470284750d999384fc2d982f61274a12b4fc9dfbd5e
  1. 查看与启动镜像
# docker image ls
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
loongsongd/debian                   v10                 89b502980b39        26 seconds ago      250MB
### 启动镜像,后台模式
# docker run -itd loongsongd/debian:v10 /bin/bash
0236c81138e4d1f684fecdcd38170f1c6e1c0fe9472b687f39e01aefd093c585
# docker ps
CONTAINER ID        IMAGE                    COMMAND        CREATED             STATUS        PORTS        NAMES
0236c81138e4        loongsongd/debian:v10    "/bin/bash"    19 seconds ago      Up 17 seconds            adoring_poincare
### 进入debian 环境
# docker exec -it 0236c81138e4 /bin/bash
root@0236c81138e4:/# 
  1. 上传镜像到docker官方仓库
    首先需要在hub.docker.com 注册帐户
# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, 
head over to https://hub.docker.com to create one.
Username: loongsongd
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
# docker push loongsongd/debian:v10
The push refers to repository [docker.io/loongsongd/debian]
960d5e9828b9: Pushed 
v10: digest: sha256:1743b6e796587961313d981af8de4ebd77fef822ce8e74e1de5e38c73c0b11b5 size: 528

你可能感兴趣的:(龙芯,linux)