码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 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
     

  • 相关阅读:
    驱动开发:内核枚举ShadowSSDT基址
    管理能力学习笔记十二:高效组织会议
    基于 flex 布局实现的三栏布局
    图像处理:以图像分类和图像深度估计为例,如何将研究想法进行迁移学习应用?
    Spring中如何在一个Bean中注入一个内部Bean呢?
    前后端分离项目Vue+node.js二手商品交易系统74qb3
    联合matlab和Arcgis进行netcdf格式的雪覆盖数据的重新投影栅格
    Python中的接口是什么?
    web前端期末大作业:美食文化网页设计与实现——美食餐厅三级(HTML+CSS+JavaScript)
    安卓讲课笔记6.1 共享参数
  • 原文地址:https://blog.csdn.net/UNknowmer/article/details/127095716
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号