I'm trying to figure out a way to run Docker on my Ubuntu machine but still use the Docker command line interface (CLI) from my Mac. I don't just mean accessing services, like running a PostgreSQL database in Docker on the other machine. What I want is to actually run the Docker CLI on my Mac, but execute the commands on the remote Ubuntu machine to save on system resources. Is this possible?
2 Answers
You can set up Docker context, which allows your Mac to connect to the Docker daemon on your remote Ubuntu server via SSH. This way, when you run Docker commands on your Mac, they actually execute on the Ubuntu server. Just make sure to configure the SSH access properly so it’s seamless!
Another option is to just SSH into your Ubuntu machine and run the Docker commands there. It might not be as smooth as using Docker context, but it works. Keep in mind that if you expose your containers to your local area network (LAN), you can access them directly from your Mac using the Ubuntu machine’s IP address and the container port.

That sounds pretty straightforward! Just ensuring everything's set up securely will be key.