-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
- https://stackoverflow.com/questions/62154016/docker-on-wsl2-very-slow | ||
# Most common error | ||
|
||
- <https://stackoverflow.com/questions/62154016/docker-on-wsl2-very-slow> | ||
|
||
- exec /usr/local/bin/kubectl: exec format error | ||
See: https://stackoverflow.com/questions/73398714/docker-fails-when-building-on-m1-macs-exec-usr-local-bin-docker-entrypoint-sh | ||
See: <https://stackoverflow.com/questions/73398714/docker-fails-when-building-on-m1-macs-exec-usr-local-bin-docker-entrypoint-sh> | ||
|
||
- Check architecure: dpkg --print-architecture | ||
|
||
- docker: Error response from daemon: Conflict. The container name "/my_devops_toolkit" is already in use by container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
# Use python in the devops-toolkit | ||
|
||
To use the existing container isntead of creating one, use `docker exec` command instead of `docker run` | ||
|
||
```bash | ||
docker exec -it my_devops_toolkit /bin/bash | ||
``` | ||
|
||
## Run python sample code provided in the container | ||
|
||
```bash | ||
docker run --name my_devops_toolkit --network host -it devops-toolkit:latest | ||
# You now in the container terminal | ||
python3 samples/python/rectangle_area_calculator.py | ||
``` | ||
|
||
## Clone external code to container | ||
|
||
```bash | ||
docker run --name my_devops_toolkit --network host -it devops-toolkit:latest | ||
# You now in the container terminal | ||
|
||
# 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 | ||
``` | ||
|
||
## Mount external code to container | ||
|
||
Clone the code to the host then mount to container | ||
|
||
```bash | ||
# Clone code on the host | ||
docker run --name my_devops_toolkit -v "$(pwd)":/root/python_workspace --network host -it devops-toolkit:latest | ||
# Run the python code as usual | ||
``` |