Created
December 29, 2025 15:14
-
-
Save erszcz/bb6b0dcbbabe7473f31d43ee07d8de9f to your computer and use it in GitHub Desktop.
Linux shell on macOS
This file contains hidden or 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
| export HOST_PWD=${PWD} | |
| export COMPOSE_PROJECT_NAME=$(basename $PWD) |
This file contains hidden or 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
| # docker-compose.yml | |
| services: | |
| linux_shell: | |
| image: docker.io/library/ubuntu | |
| command: sleep infinity | |
| volumes: | |
| - ${HOST_PWD}:${HOST_PWD} | |
| working_dir: ${HOST_PWD} |
This file contains hidden or 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
| .PHONY: linux-shell | |
| linux-shell: | |
| docker compose up -d | |
| docker exec -it $$COMPOSE_PROJECT_NAME-linux_shell-1 bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment