docker build --tag custom-admin-cli:latest .
Run the container in detached mode with the scripts mounted
docker run --name admin-cli -v ${PWD}/scripts:/scripts -d custom-admin-cli:latest
docker run --name admin-cli -v %cd%/scripts:/scripts -d custom-admin-cli:latest
Execute the script within the container
docker exec admin-cli python /scripts/admin-cli.py
- When adding extra python dependency through the requirement.txt file make sure to rebuild the image and run a new container:
docker stop admin-cli && docker rm admin-cli
docker build --tag custom-admin-cli:latest .
docker run -d custom-admin-cli:latest --name=admin-cli -v ./scripts:/scripts