开发测试镜像
懒猫开发者工具 支持 docker registry v2 API, 您可以按照下面方法将本地的测试镜像推送到盒子进行测试。
创建
DockerfileDockerfileFROM busybox:latest #lzcapp中的所有service都必须一直处于运行状态,否则应用会进入错误状态 CMD ["sleep", "1d"]FROM busybox:latest #lzcapp中的所有service都必须一直处于运行状态,否则应用会进入错误状态 CMD ["sleep", "1d"]构建镜像
shdocker build --platform linux/amd64 -t lzc/helloworld:latest .docker build --platform linux/amd64 -t lzc/helloworld:latest .如果您当前是使用ARM64或非x86架构,需要通过
--platform强制指定平台为linux/amd64.重新
tag镜像成dev.$BOXNAME.heiyu.space地址,$BOXNAME为目标盒子名.shBOXNAME=$(lzc-cli box default) docker tag lzc/helloworld:latest dev.$BOXNAME.heiyu.space/lzc/helloworld:latestBOXNAME=$(lzc-cli box default) docker tag lzc/helloworld:latest dev.$BOXNAME.heiyu.space/lzc/helloworld:latest推送镜像
shdocker push dev.$BOXNAME.heiyu.space/lzc/helloworld:latestdocker push dev.$BOXNAME.heiyu.space/lzc/helloworld:latestlzc-build.yml或者lzc-manifest.yml中使用ymlservices: helloworld: image: dev.$BOXNAME.heiyu.space/lzc/helloworld:latestservices: helloworld: image: dev.$BOXNAME.heiyu.space/lzc/helloworld:latest拉取镜像
shdocker pull dev.$BOXNAME.heiyu.space/lzc/helloworld:latestdocker pull dev.$BOXNAME.heiyu.space/lzc/helloworld:latest