Some days ago, I got a call from someone asking for a solution. Due to global pandemic they were unable to hand over a laptop to new employee. They wanted the new employee to access a certain websites but did not wish to share the passwords.
Their idea : provide access to already-logged-in browser to the new person, so they would have access to the sites, but do not need the passwords.
They had considered AWS workspaces - but it is costly. (Finally they got some “Free for a couple of months” deal, and used as their final solution)
I suggested “Chrome in Docker”. The conversation ended, but it intrigued me and wanted to try it out myself.
I started with this but it did not work as-is for me. Partially because (I think) the original repo assumes linux host, and I am on macOS. So I had to make some changes.
Summary of my changes
- I included the
chrome.jsonin the repo. See details about this file in the Dockerfile comments.
- I had to replace
libpangoxsince the original repo is couple years old.
talk-plugincause I don't need it.
run.sh- because the
dockercommand becomes too long, and changing a param becomes PITA
--deviceparams because it does not apply to macOS (I think)
- Finally, I needed XServer, which comes with linux but not macOS. Hence
brew cask install xquartz
Bit of Troubleshooting
Where is the fun if things work in the first attempt ?
I kept getting
Unable to Open XDisplay error.
To fix the error, I had to set the
ip as per
setxhost.sh to simplify this. (Originally it was part of
You can see all my changes in my git repo which contains all my modification.
The README has detailed instructions to try this on your mac.