Goal:
We are creating dev environments for developers in GCP cloud.
Every developer would have a dedicated Linux VM in GCP for day to day development tasks & testing
Linux VM is a dev environment(with multiple tools installed for source code checkout etc…). Docker daemon is another tool, needed, for day to day tasks.
So, Linux VM should have docker daemon(installed) to launch docker containers(for testing).
Can we install docker daemon on Linux VM? if yes, please provide steps..
2
Answers
You can refer the document provided by digital ocean.
I was able to successfully setup docker using the above and once docker is installed, make sure to add your user into docker group. Please refer this link for post installation tasks.
When I build VMs for developers that require Docker, I use a startup script so that Docker is installed when the VM is created. This script can also be used in a terminal window to manually install Docker.
This script is for Debian/Ubuntu systems.
One variable is required. $USER needs to be added to the docker group so that users can run containers without sudo permissions. This script runs commands with
sudo
which is not required as a startup script but is required for a normal user.