Skip to content

Instantly share code, notes, and snippets.

@avillela
Last active May 30, 2025 00:24
Show Gist options
  • Save avillela/edf18f4d92f3a150eafcfc353c28cc7e to your computer and use it in GitHub Desktop.
Save avillela/edf18f4d92f3a150eafcfc353c28cc7e to your computer and use it in GitHub Desktop.

Revisions

  1. avillela revised this gist Feb 9, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dockerized_argocd_cli.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ ENTRYPOINT [ "argocd" ]
    Builds the file `Dockerfile.argocd`, located in the `docker` folder. Build context is `docker`

    ```bash
    docker build -f docker/Dockerfile.argocd -t docker-argocd:1.0.0 docker
    docker build -f docker/Dockerfile.argocd -t argocd-cli:1.0.0 docker
    ```

    ## Run
    @@ -31,7 +31,7 @@ Create an alias and add it to your `.bashrc`. This maps your local `.kube/config
    If you use Windows, alias creation will be a bit different for you. If you use a different 'nix shell, such as fish, for example, you'll save the alias to `~/.config/fish/config.fish` instead.

    ```bash
    alias argocd='docker run -it --rm -v ~/.kube/config:/root/.kube/config -v ~/.argocd/config:/root/.argocd/config docker-argocd:1.0.0' >> ~/.bashrc
    alias argocd='docker run -it --rm -v ~/.kube/config:/root/.kube/config -v ~/.argocd/config:/root/.argocd/config argocd-cli:1.0.0' >> ~/.bashrc
    ```

    Run your favorite `argocd` commands. For example:
  2. avillela revised this gist Jan 30, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions dockerized_argocd_cli.md
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,8 @@ docker build -f docker/Dockerfile.argocd -t docker-argocd:1.0.0 docker

    Create an alias and add it to your `.bashrc`. This maps your local `.kube/config` and local `./argocd/config` files to the ones in the container.

    If you use Windows, alias creation will be a bit different for you. If you use a different 'nix shell, such as fish, for example, you'll save the alias to `~/.config/fish/config.fish` instead.

    ```bash
    alias argocd='docker run -it --rm -v ~/.kube/config:/root/.kube/config -v ~/.argocd/config:/root/.argocd/config docker-argocd:1.0.0' >> ~/.bashrc
    ```
  3. avillela created this gist Jan 30, 2021.
    41 changes: 41 additions & 0 deletions dockerized_argocd_cli.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    # How to Build & Run Dockerized ArogCD CLI

    This quick guide shows you how to build a Dockerized `argocd` CLI. The advantage of this setup is that it's platform-independent. Also, I personally found the Linux installation annoying and buggy, and this proves to be a much more streamlined approach. Interestingly enough, the MacOS and the Windows installers were way less finnicky.

    ## Dockerfile

    Save the text below to `Dockerfile.argocd` in a folder called `docker`

    ```dockerfile
    FROM argoproj/argocd:v1.7.6 as builder

    FROM ubuntu:18.04 as app

    COPY --from=builder /usr/local/bin/argocd /usr/local/bin/argocd

    ENTRYPOINT [ "argocd" ]
    ```

    ## Build

    Builds the file `Dockerfile.argocd`, located in the `docker` folder. Build context is `docker`

    ```bash
    docker build -f docker/Dockerfile.argocd -t docker-argocd:1.0.0 docker
    ```

    ## Run

    Create an alias and add it to your `.bashrc`. This maps your local `.kube/config` and local `./argocd/config` files to the ones in the container.

    ```bash
    alias argocd='docker run -it --rm -v ~/.kube/config:/root/.kube/config -v ~/.argocd/config:/root/.argocd/config docker-argocd:1.0.0' >> ~/.bashrc
    ```

    Run your favorite `argocd` commands. For example:

    ```bash
    argocd version
    argocd repo add
    argocd login
    ```