My program need to docker build first ,and then push to the harbor, last deployment with k8s.
But the hard disk of my local machine is too small. so I don't want to install docker in local, so I need to send the program to the remote machine with docker,and then execute the script. It is so complex.
So I think that if all this can be done directly locally. Kubectl can operate remote machines directly locally, But docker cant do that , so I want to implement one .
too complex !
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server-liunx server/main.go go build -o docker client/main.go Notice : In order to use the same as the docker, the client is named docker. Of course, you can also name it another , but please change it to the name you named when you encounter the docker command later
Copy the "server" to the machine with docker
nohup server-liunx -p 50000 &- linux mac osx
export DOCKER_REMOTE_SERVER=ip:porte.g.
export DOCKER_REMOTE_SERVER=192.168.1.16:50000Write the above script to ~ /.bash_profile file
then
source ~/.bash_profile notice : Write "source ~/.bash_profile" to ~/.zshrc if it doesn't work after Mac OSX restarts
If there is no ~/.zshrc, please create a new one.
- windows
My Computer right button Properties -> Advanced settings -> Environment Variable
Enter the directory where the "docker" is located. It is recommended to copy the docker to $path
type
dockerView all commands .
In fact, it's the docker command, such as viewing all the image lists
docker images If prompt "command not find" in work directory, you can type
./docker Or copy docker to $path