[GH-ISSUE #46] Add a Dockerfile to allow git-sim running via docker #36

Closed
opened 2026-03-02 16:47:25 +03:00 by kerem · 10 comments
Owner

Originally created by @borekb on GitHub (Feb 5, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/46

Tools built in Python are quite tricky for me to run on macOS and I know many other people struggle with it too, would you consider publishing a Docker image to make consuming this awesome looking utility easier? It looks really great!

Originally created by @borekb on GitHub (Feb 5, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/46 Tools built in Python are quite tricky for me to run on macOS and I know many other people struggle with it too, would you consider publishing a Docker image to make consuming this awesome looking utility easier? It looks really great!
kerem 2026-03-02 16:47:25 +03:00
Author
Owner

@initialcommit-io commented on GitHub (Feb 5, 2023):

Hi @borekb! That sounds like a good suggestion. I worked with Docker several years ago but it's been a while. It would take me some time to get familiar again and we're also working on various other enhancements to git-sim at the moment.

Any chance you want to try your hand at creating a working Docker image and submitting a pull request? Happy to provide guidance on what needs to be included, and help troubleshooting if you run into issues.

<!-- gh-comment-id:1418209486 --> @initialcommit-io commented on GitHub (Feb 5, 2023): Hi @borekb! That sounds like a good suggestion. I worked with Docker several years ago but it's been a while. It would take me some time to get familiar again and we're also working on various other enhancements to git-sim at the moment. Any chance you want to try your hand at creating a working Docker image and submitting a pull request? Happy to provide guidance on what needs to be included, and help troubleshooting if you run into issues.
Author
Owner

@borekb commented on GitHub (Feb 5, 2023):

It's also been some time for me 😄. I'll try to pair with ChatGPT next weekend to come up with something 🤞.

<!-- gh-comment-id:1418263544 --> @borekb commented on GitHub (Feb 5, 2023): It's also been some time for me 😄. I'll try to pair with ChatGPT next weekend to come up with something 🤞.
Author
Owner

@initialcommit-io commented on GitHub (Feb 5, 2023):

Haha sounds good! Let me know if you get stuck on anything or if you have any implementation questions.

<!-- gh-comment-id:1418294981 --> @initialcommit-io commented on GitHub (Feb 5, 2023): Haha sounds good! Let me know if you get stuck on anything or if you have any implementation questions.
Author
Owner

@Averagess commented on GitHub (Feb 9, 2023):

Hello @borekb, could you check if the Dockerfile works for you on macOS?

<!-- gh-comment-id:1424874545 --> @Averagess commented on GitHub (Feb 9, 2023): Hello @borekb, could you check if the Dockerfile works for you on macOS?
Author
Owner

@initialcommit-io commented on GitHub (Feb 9, 2023):

@Averagess Thanks for this! I was able to get it to work on MacOS Monterey, so I'll merge the PR.

FYI for other Mac users out there - I had crazy issues setting up docker with docker-machine and virtualbox from the command-line using Homebrew. It was much easier to set up by manually downloading/installing docker on Macos from here: https://docs.docker.com/desktop/install/mac-install/

<!-- gh-comment-id:1424901863 --> @initialcommit-io commented on GitHub (Feb 9, 2023): @Averagess Thanks for this! I was able to get it to work on MacOS Monterey, so I'll merge the PR. FYI for other Mac users out there - I had crazy issues setting up docker with docker-machine and virtualbox from the command-line using Homebrew. It was much easier to set up by manually downloading/installing docker on Macos from here: https://docs.docker.com/desktop/install/mac-install/
Author
Owner

@initialcommit-io commented on GitHub (Feb 9, 2023):

@Averagess Actually quick question - since it's tedious to run git-sim using long docker commands like docker run --rm -v $(pwd):/usr/src/git-sim git-sim log, can you suggest how to alias those commands on Windows/Linux/MacOS so that they can simply be run as git-sim log?

It might be possible by setting up an alias like (pseudocode):

alias git-sim = docker run --rm -v $(pwd):/usr/src/git-sim git-sim

So that running git-sim on its own plus a subcommand/options would trigger the program. If that works, we can add that into the README as a helpful note for those who want to run using docker.

<!-- gh-comment-id:1424907460 --> @initialcommit-io commented on GitHub (Feb 9, 2023): @Averagess Actually quick question - since it's tedious to run git-sim using long docker commands like `docker run --rm -v $(pwd):/usr/src/git-sim git-sim log`, can you suggest how to alias those commands on Windows/Linux/MacOS so that they can simply be run as `git-sim log`? It might be possible by setting up an alias like (pseudocode): alias git-sim = docker run --rm -v $(pwd):/usr/src/git-sim git-sim So that running `git-sim` on its own plus a subcommand/options would trigger the program. If that works, we can add that into the README as a helpful note for those who want to run using docker.
Author
Owner

@Averagess commented on GitHub (Feb 9, 2023):

@initialcommit-io With Docker alone, most likely not possible.

For Bash, you can write your own alias functions inside the .bashrc file
check out this stackoverflow guide

I got mine working with Git Bash on Windows, i put this function inside my .bashrc file.
git-sim() { docker run --rm -v /$(pwd):/usr/src/git-sim git-sim "$@" }

for macOS and linux this should work:

git-sim() { docker run --rm -v $(pwd):/usr/src/git-sim git-sim "$@" }

Now only running git-sim with params, works

For Windows Powershell its a bit more complicated, but you can define same functions as aliases
i followed this guide
and this

  • Open powershell, type Notepad $PROFILE and inside the notepad put this function:
    function git-sim { docker run --rm -v ${PWD}:/usr/src/git-sim git-sim $args }
  • Save the file and close
  • To run these functions, you have to have set the execution policy to RemoteSigned
  • Check the value of this by running Get-ExecutionPolicy
  • If its restricted, set it to Set-ExecutionPolicy RemoteSigned, note that you might have to run powershell as administrator to it have effect
  • Restart powershell, and you should be now able to only use git-sim params... inside powershell
<!-- gh-comment-id:1424978976 --> @Averagess commented on GitHub (Feb 9, 2023): @initialcommit-io With Docker alone, most likely not possible. For Bash, you can write your own alias functions inside the .bashrc file [check out this stackoverflow guide](https://stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter) I got mine working with Git Bash on Windows, i put this function inside my .bashrc file. ` git-sim() { docker run --rm -v /$(pwd):/usr/src/git-sim git-sim "$@" } ` for macOS and linux this should work: ` git-sim() { docker run --rm -v $(pwd):/usr/src/git-sim git-sim "$@" } ` Now only running git-sim with params, works For Windows Powershell its a bit more complicated, but you can define same functions as aliases [i followed this guide](https://stackoverflow.com/questions/4166370/how-can-i-write-a-powershell-alias-with-arguments-in-the-middle) [and this](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.3) - Open powershell, type `Notepad $PROFILE` and inside the notepad put this function: `function git-sim { docker run --rm -v ${PWD}:/usr/src/git-sim git-sim $args }` - Save the file and close - To run these functions, you have to have set the execution policy to RemoteSigned - Check the value of this by running `Get-ExecutionPolicy` - If its restricted, set it to `Set-ExecutionPolicy RemoteSigned`, note that you might have to run powershell as administrator to it have effect - Restart powershell, and you should be now able to only use `git-sim params...` inside powershell
Author
Owner

@initialcommit-io commented on GitHub (Feb 10, 2023):

@Averagess Sweet! I'll merge the PR now and then update the README with the Docker steps and your suggestions for aliasing. Thanks again and if you ever want to work on other aspects of Git-Sim let me know!

<!-- gh-comment-id:1425018881 --> @initialcommit-io commented on GitHub (Feb 10, 2023): @Averagess Sweet! I'll merge the PR now and then update the README with the Docker steps and your suggestions for aliasing. Thanks again and if you ever want to work on other aspects of Git-Sim let me know!
Author
Owner

@borekb commented on GitHub (Feb 10, 2023):

I didn't realize this earlier but there already was https://hub.docker.com/r/cvagner/git-sim 8 days ago – it's created by @cvagner and the repo behind it is https://github.com/cvagner/docker-git-sim.

So now I have two options how to run git-sim via Docker – open source is awesome 😄.

<!-- gh-comment-id:1425460983 --> @borekb commented on GitHub (Feb 10, 2023): I didn't realize this earlier but there already was https://hub.docker.com/r/cvagner/git-sim 8 days ago – it's created by @cvagner and the repo behind it is https://github.com/cvagner/docker-git-sim. So now I have _two_ options how to run git-sim via Docker – open source is awesome 😄.
Author
Owner

@cvagner commented on GitHub (Feb 10, 2023):

Hi,
Sorry, I should have proposed the work I've done (quickly and tested on Linux only) ! Like @borekb, I wanted to test the application without installing all kind of stuffs on my PC.

<!-- gh-comment-id:1425779018 --> @cvagner commented on GitHub (Feb 10, 2023): Hi, Sorry, I should have proposed the work I've done (quickly and tested on Linux only) ! Like @borekb, I wanted to test the application without installing all kind of stuffs on my PC.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#36
No description provided.