Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dapr CLI Docker Image #1339

Closed
wants to merge 3 commits into from
Closed

Conversation

mindovermiles262
Copy link

Description

This PR adds a workflow to publish Dapr CLI to docker hub when there is a new release. This PR will require help with a few things from Maintainers:

  • A daprio/cli Docker hub repository created
  • Secrets for DOCKER_REGISTRY_ID and
  • Secret for DOCKER_REGISTRY_PASSWORD created.

Issue reference

None

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Andrew Duss <andrew.duss@storable.com>
Signed-off-by: Andrew Duss <andrew.duss@storable.com>
Signed-off-by: Andrew Duss <andrew.duss@storable.com>
@shubham1172
Copy link
Member

Hi @mindovermiles262, since Dapr CLI is a self-contained binary available for all platforms, what is the purpose for having a docker image?

@mindovermiles262
Copy link
Author

mindovermiles262 commented Sep 14, 2023

I have a use case where I want to run a job on my kubernetes cluster using dapr cli. Something like:

apiVersion: batch/v1
kind: Job
metadata:
  name: dapr-cli
spec:
  template:
    spec:
      containers:
      - name: dapr-cli
        image: daprio/cli
        command: ["dapr", "..."]

I did a quick search but couldn't find any existing image with dapr-cli already installed.

@shubham1172
Copy link
Member

shubham1172 commented Sep 14, 2023

@mindovermiles262 how about a workaround like the following?

apiVersion: batch/v1
kind: Job
metadata:
  name: dapr-cli
spec:
  template:
    spec:
      containers:
      - name: dapr-container
        image: alpine:latest  # Maybe try distroless if not alpine, commands below are roughly written
        command:
          - "/bin/sh"
          - "-c"
          - |
            apk add --update --no-cache curl
            curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/sh # or you can simply wget the binary
            dapr command
      restartPolicy: Never
  backoffLimit: 1

@mindovermiles262
Copy link
Author

Sure, that would work, but it seems like the cli should be available as a container

@shubham1172
Copy link
Member

shubham1172 commented Sep 14, 2023

Sure, that would work, but it seems like the cli should be available as a container

If there are more use-cases or requirements from the community I'd be happy to vote in favor. For one specific use case it might be an overkill to maintain yet another GitHub pipeline and have yet another Docker image (which will support a single platform - linux/amd64 as per this PR).

^Just my opinion, maintainers might have something else to add.

@mindovermiles262
Copy link
Author

Fair enough. Let me move this to an Issue for future reference. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants