In some cases, you may want to run the Docker build using the extra resources.
Instead of hogging the laptop RAM and CPU while it is building the docker images.
With docker machine, you are now able to do it pretty much quickly.
Here are the step:
- Install and run VPN server on the remote machine (optional)
- Install and run the docker daemon in the remote machine
- Connect to its port using VPN port (allow firewall setting to the VPN server port)
- Otherwise, you will have to open the docker port itself and expose on public IP before can connect it
- Add docker context with the remote docker machine, and set to use this context
- Run docker build and the rest of the build command using the context
- Run docker-compose using context to test
- Run SSH port forward to local port to access the serving port
That’s it!
Leave a Comment