Skip to content

Instantly share code, notes, and snippets.

@kevinyan815
Last active November 30, 2021 08:00
Show Gist options
  • Save kevinyan815/ec1c901f0887d3a40b58c1b020bd29a0 to your computer and use it in GitHub Desktop.
Save kevinyan815/ec1c901f0887d3a40b58c1b020bd29a0 to your computer and use it in GitHub Desktop.
## docker login to platform other than dockerhub
docker login --username=hi31209766@aliyun.com registry.cn-hangzhou.aliyuncs.com
## dockcer build
docker build -t registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2 .
## docker push
docker push registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2
## docker run
docker run --name go-profile-demo -v /tmp:/tmp -p 8080:3000 --rm registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2
// --name for container alias, -p for port host port and container port mapping,
// -v for volume host volume and container volume mapping,
// --rm for delete container after container stopped
## show docker containers
docker container ls
## bash in container
docker exec -it containerid/container_name /bin/sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment