free docker image hosting, ali cloud container image service

commonly used image hosting technology

1.self-built(registry,harbor,etc)

2.hosting platform(tencent cloud,aliyun etc)

address of ali cloud container image service:

https://cr.console.aliyun.com

praparatory work

1.coding go project

package main

import "fmt"

func main() {
	fmt.Println("helloworld")
}
go run main.go

2.pacakge the project

GOOS=linux GOARCH=amd64 go build main.go

3.upload  files to the server and run the project in the background....

4.coding Dockerfile and package helloworld project

#under the project level directory,create a new Dockerfile

FROM alpine:latest
COPY main /app/main
#ENTRYPOINT ["/user-srv"]
CMD ["/app/main"]

5.generate docker images

#docker images helloo , . is the dockerfile directory location

docker build -t hello:v1 .

6.run the helloo container

docker run hello:v1

give the image a label  

docker tag hello:v1 registry.cn-hangzhou.aliyuncs.com/gosrc/godemo:v1

 view mirror 

docker images

 Log in to Aliyun Docker Registry

docker login --username=hi313*****@aliyun.com registry.cn-hangzhou.aliyuncs.com

 push the image to registry 

docker push registry.cn-hangzhou.aliyuncs.com/gosrc/godemo:v1

3.deploy docker images to the target server

log in to Ali Cloud docker server at the target server terminal

docker login --username=hi313*****@aliyun.com registry.cn-hangzhou.aliyuncs.com

pull the image to the local server on the target server

docker pull registry.cn-hangzhou.aliyuncs.com/gosrc/godemo:v1

run the docker container

docker run registry.cn-hangzhou.aliyuncs.com/gosrc/godemo:v1
docker ps -a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值