Common Docker Operations and Commands
Create Docker Image for Python Projects
- Configure Dependencies
1 | pip freeze > requirements.txt |
- Create and Edit Dockerfile
1 | FROM python:3.10.12 |
- Build Docker Image & run
1 | docker build -t demo . |
Pull or Push Docker Images
login to Docker Hub;
1 | [root@localhost ~] |
Edit Tag
- Push Command
docker push docker_username/REPOSITORY:TAG
- We need to edit the tag and repository name:
1 | [root@localhost ~]# docker images |
Push
1 | [root@localhost ~]# docker push ***/demo:v1 |
Pull
1 | [root@localhost ~]# docker pull ***/demo:v1 |