docker run --name swagger -d -p 80:80 core3.x-swagger
可以看到我们的容器已经启动好了。
1 2 3 4
[root@instance-p0a4erj8 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES eb38557539a9 core3.x-swagger "dotnet Web.dll" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp swagger
可以查看一下日志:
1 2 3 4 5 6 7 8 9 10 11 12
[root@instance-p0a4erj8 ~]# docker logs eb38557539a9 info: Microsoft.Hosting.Lifetime[0] Now listening on: http://[::]:80 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect.
[root@instance-p0a4erj8 ~]# docker login --username=xxxxxx registry.cn-hangzhou.aliyuncs.com 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
推送镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/52fx/52fx:[镜像版本号] docker push registry.cn-hangzhou.aliyuncs.com/52fx/52fx:[镜像版本号]