$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e6ae7638a58d demo "/bin/sh -c '/data/start.sh'" 8 seconds ago Up 7 seconds 80/tcp, 8080/tcp loving_neumann
$ docker exec -i -t e6ae7638a58d sh # id uid=0(root) gid=0(root) groups=0(root)
如果默认进去的不是root权限,可以增加-u root参数。
清理磁盘空间
1
$ docker system prune -a -f
0x05 登录docker仓库
登录官方仓库
1 2 3 4 5 6 7 8 9
$ docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one. Username: drunkdream 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
$ docker login hub.tencentyun.com Username: drunkdream 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
如果仓库使用的不是HTTPS的443端口,需要在主机名后面加上:port。
如果提示以下错误:
1
Error response from daemon: Get https://hub.private.com:8080/v2/: http: server gave HTTP response to HTTPS client
$ docker search python NAME DESCRIPTION STARS OFFICIAL AUTOMATED python Python is an interpreted, interactive, objec… 5022 [OK] django Django is a free web application framework, … 941 [OK] pypy PyPy is a fast, compliant alternative implem… 234 [OK] kaggle/python Docker image for Python scripts run on Kaggle 138 [OK] arm32v7/python Python is an interpreted, interactive, objec… 48 joyzoursky/python-chromedriver Python with Chromedriver, for running automa… 43 [OK] nikolaik/python-nodejs Python with Node.js 40 [OK] centos/python-35-centos7 Platform for building and running Python 3.5… 38 circleci/python Python is an interpreted, interactive, objec… 37 centos/python-36-centos7 Platform for building and running Python 3.6… 28 hylang Hy is a Lisp dialect that translates express… 27 [OK] arm64v8/python Python is an interpreted, interactive, objec… 21 centos/python-27-centos7 Platform for building and running Python 2.7… 17 publicisworldwide/python-conda Basic Python environments with Conda. 6 [OK] bitnami/python Bitnami Python Docker Image 6 [OK] dockershelf/python Repository for docker images of Python. Test… 5 [OK] i386/python Python is an interpreted, interactive, objec… 3 centos/python-34-centos7 Platform for building and running Python 3.4… 2 komand/python-plugin DEPRECATED: Komand Python SDK 2 [OK] ppc64le/python Python is an interpreted, interactive, objec… 2 amd64/python Python is an interpreted, interactive, objec… 1 ccitest/python CircleCI test images for Python 0 [OK] s390x/python Python is an interpreted, interactive, objec… 0 openshift/python-33-centos7 DEPRECATED: A Centos7 based Python v3.3 imag… 0 saagie/python Repo for python jobs 0