Run fleetctl inside a Docker container
1.4K
Use fleetctl inside a Docker container.
Run container with fleetctl --help command:
docker run -it --rm \
--volume=$HOME/.ssh/id_rsa:/home/fleet/.ssh/id_rsa:ro \
--volume=$HOME/.fleetctl:/home/fleet/.fleetctl \
--name=fleet --user=fleet \
czerasz/fleetctl --help
NOTE
Only the--helpargument needs to be passed.
Use container with ~/.ssh/digitalocean.com ssh key:
docker run -it --rm \
--volume=$HOME/.ssh/digitalocean.com:/home/fleet/.ssh/id_rsa:ro \
--volume=$HOME/.fleetctl:/home/fleet/.fleetctl \
--name=fleet --user=fleet \
czerasz/fleetctl
Run bash shell inside the container to execute multiple commands:
docker run -it --rm \
--volume=$HOME/.ssh/id_rsa:/home/fleet/.ssh/id_rsa:ro \
--volume=$HOME/.fleetctl:/home/fleet/.fleetctl \
--name=fleet --user=fleet \
--entrypoint=/bin/bash \
czerasz/fleetctl
To build the Docker image locally run the following commands:
Download Project:
git clone [email protected]:czerasz/docker-fleetctl && cd docker-fleetctl
Build the Docker image:
./scripts/build.sh
You can change the build behavior with environment variables:
user_id=<id> version=<version> image_name=<name> ./scripts/build.sh
Where:
user_id - id of the user you plan to work with fleetctlversion - fleetctl version which should be buildimage_name - name of the Docker imageIf you cloned the project, you can benefit from the run script.
Simply adjust it according to your needs and execute with:
./scripts/run
If you cloned the project, you can benefit from the export script.
Run the following command to download the fleetctl binary to the scripts directory:
./scripts/export
Now the ./scripts/fleetctl will be available to your service:
./scripts/fleetctl --help
This image is created with the assumption that you use a desktop user which has the uid equal to 1000.
For more information check out the Dockerfile and the #7198 issue comment.
Content type
Image
Digest
Size
249.2 MB
Last updated
over 10 years ago
docker pull czerasz/fleetctl