I'm trying to find a way to run the Docker command line interface (CLI) on my Mac and have it point to an instance of Docker that's running on my Ubuntu machine. I'm looking to save resources on my Mac, which is currently using around 8GB of RAM for Docker. I understand that I can connect to services like a Postgres database running in Docker on another machine, but I'm asking if there's a way to actually run Docker commands on my Mac while using the Docker engine on a different machine altogether.
4 Answers
You can check out the Docker context feature! It allows you to set up an SSH connection to your remote server and execute your Docker commands there as if you were running them locally. This would save you a lot of resources on your Mac. Just make sure to set it up properly for SSH access!
You can set up your containers on the Ubuntu machine and expose them to your local network. Just make sure you're using the local IP address followed by the specific port of your container when accessing it from your Mac. This way, you can manage everything from there!
Another option is to run services like Podman instead, which might have lower overhead. But if you're strictly looking for Docker, using Docker context is the best solution. You still need a Linux VM running behind the scenes, which is why you're seeing high RAM usage on your Mac.
If you're comfortable with SSH, you can also just log into your Ubuntu machine and use the Docker CLI directly there. You'd execute your commands remotely, which should help with the memory issues on your Mac.

Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux