Then your CLI commands will be sent to your Linux server's Daemon. Once you have a context created, you can switch to that context using docker context use remote-linux-server. To create a context named "remote-linux-server", you can do something like: docker context create -docker "host=tcp://:" remote-linux-server This allows you to create different contexts for your CLI. You can read more about docker contexts here and information on how to create contexts here. It can obviously be annoying to specify that variable every time, so the second way you can do this is by creating a Docker Context. If for example you wanted to run an nginx container on your remote daemon, you could run the following DOCKER_HOST=“tcp://:” docker run -d -p 8080:80 nginx Once you have the CLI on your Mac (either by building the Docker CLI from source or just using Docker Desktop for Mac), you can connect to your Linux server from your Mac with the Docker CLI in two ways.įirst, you can do it by specifying the host of your remote Docker Daemon when you run a command. I just built the CLI late last week and I had to play with it a bit in before I got it to build locally, but you can do it. They recently (just this past week) changed how the CLI is built as it's now using Buildkit, so I will admit, you will probably have to tinker with it a bit if you want to install it from source since they're in the middle of updating the documentation on building it. If you still just want to install the CLI, then checkout the Repo here and read the instructions to build the CLI from source. But if you really don't want the container runtime and the daemon running on your Mac, then you'll have to install the CLI manually. Alternatively, you could just install Docker Desktop, and then just configure your CLI to connect to your Linux server. Since most people setup Docker Desktop with a Mac and not just the CLI, it will take some manual configuration if you really just want the CLI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |