I’m thinking about installing command line tools to CoreOS via fleet unit files. This idea comes from Kubernetes Installation on CoreOS. As usual to install binaries written in Go is very easy, just put it somewhere in your path. Combining with fleet oneshot service, I’m going to install a Google Drive CLI client on CoreOS.
Google Drive CLI install
gdrive is a command line utility for Google Drive. Thankfully this tool is written in Go, the installation is just saving a binary to a location in your path. For CoreOS I download a drive-linux-amd64 v1.3.0 binary.
Oneshot fleet unit file
I prepare a fleet unit file for installing gdrive command file. This file is described as Type=oneshot
and RemainAfterExit=yes
in [Service]
directive. The definitions are suitable for command installation.
[Unit] |
And start a gdrive.service fleet unit.
$ fleetctl submit gdrive.service |
Using gdrive command
For the first time of running gdrive command it requires a OAuth certificate. Following the instruction I open the url in you browser and get the verification code.
$ gdrive |
Basic usage examples are in gdrive’s README.
drive [global options] <verb> [verb options] |