Sign inSign up

czerasz/fleetctl

By czerasz

Updated over 10 years ago

Run fleetctl inside a Docker container

Image
0

1.4K

czerasz/fleetctl repository overview

Fleetctl Docker Image

Use fleetctl inside a Docker container.

Usage Examples

  • 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 --help argument 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
    

Build Image Locally

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 fleetctl
  • version - fleetctl version which should be build
  • image_name - name of the Docker image

Bonus

Run Helper Script

If you cloned the project, you can benefit from the run script. Simply adjust it according to your needs and execute with:

./scripts/run
Export Fleetctl Binary

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

Important Note

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.

Tag summary

Content type

Image

Digest

Size

249.2 MB

Last updated

over 10 years ago

docker pull czerasz/fleetctl