Some document to help you start with python
Navigate to your workspace folder, then run:
devops-toolkit-cli init demo_python01
devops-toolkit-cli run demo_python01
# You now in the container terminal. Execute the python command normally
python3 --version
It will mount the workspace code to container and you then can execute desired scripts inside the devops-toolkit
container
To use the existing container instead of creating one, use docker exec
command instead of docker run
# Given that we have 'my_devops_toolkit' start before
docker exec -it my_devops_toolkit /bin/bash
For instructions on common run modes, visit DevOps Toolkit Common Run Mode.
docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
# You now in the container terminal
python3 samples/python/rectangle_area_calculator.py
docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
# You now in the container terminal
# Clone code
mkdir python_workspace
cd python_workspace
# Clone code
mkdir python_workspace; cd python_workspace
git clone https://github.com/geekcomputers/Python.git
# Now run your cloned script
cd Python
python3 Day_of_week.py
Clone the code to the host then mount to container
# Given that we have code somewhere in you machine
docker run --rm -v "$(pwd)":/root/python_workspace --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
# Run the python code as usual
- For any issues, check this reference