• docker提交镜像到阿里ack整体流程


    本笔记为阿里云天池龙珠计划Docker训练营的学习内容,链接为:https://tianchi.aliyun.com/specials/activity/promotion/aicampdocker;

    ➜  testv0928 mkdir docker_test01
    ➜  testv0928 cd docker_test01 

    使用ack账号登陆docker
    ➜  docker_test01 docker login --username=**** registry.cn-hangzhou.aliyuncs.com
      Password: 
      Login Succeeded
      Logging in with your password grants your terminal complete access to your account. 
      For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
    ➜  docker_test01 vim math.py
    ➜  docker_test01 vim run.sh
    ➜  docker_test01 cat math.py
      import torch
      device = torch.device("cuda")
      a = torch.randn(3, 3)
      b = torch.randn(3, 3)
      a = a.to(device)
      b = b.to(device)
      c = torch.matmul(a,b)
      print(c)
    ➜  docker_test01 cat run.sh
      #bin/bash
      #打印GPU信息
      nvidia-smi
      #执行math.py
      python3 math.py
    ➜  docker_test01 vim Dockerfile
    ➜  docker_test01 cat Dockerfile 
      # Base Images
      ## 从天池基础镜像构建(from的base img 根据自己的需要更换,建议使用天池open list镜像链接:https://tianchi.aliyun.com/forum/postDetail?postId=67720)
      FROM registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.4-cuda10.1-py3
      
      ##安装依赖包,pip包请在requirements.txt添加
      #RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
      
      ## 把当前文件夹里的文件构建到镜像的//workspace目录下,并设置为默认工作目录
      ADD math.py /workspace
      ADD run.sh /workspace
      WORKDIR /workspace
      
      ## 镜像启动后统一执行 sh run.sh
      CMD ["sh", "run.sh"]
    ➜  docker_test01 docker build -t registry.cn-hangzhou.aliyuncs.com/ly_22_test/docker_test01:01
      "docker build" requires exactly 1 argument.
      See 'docker build --help'.
      
      Usage:  docker build [OPTIONS] PATH | URL | -
      
      Build an image from a Dockerfile
    ➜  docker_test01 ls                                                                           
        Dockerfile math.py    run.sh
    ➜  docker_test01 ll
      total 24
     

  • 相关阅读:
    3D医学影像PACS系统源代码
    [含lw+源码等]小程序问答论坛+后台管理系统[包运行成功]Java毕业设计计算机毕设
    二、企业快速开发平台Spring Cloud+Spring Boot+Mybatis+ElementUI之Lua 环境安装
    【高并发基础】MySQL索引优化
    算法题:分别用c++/python/java实现回文数
    猿创征文|C++软件开发值得推荐的十大高效软件分析工具
    人工智能技术概述_1.人工智能的概念及发展历程
    C. Friends and Gifts
    智慧能源:引领未来的能源革命
    【数据结构】图的实现
  • 原文地址:https://blog.csdn.net/UNknowmer/article/details/127095716