-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
I recently needed to run the CLI inside containers (due to our CI platform). Not sure if there's an existing solution to run the CLI inside Docker because the CLI also spawn containers. What I've temporarily done is to just use docker:dind to accomplish this.
Dockerfile goes like this:
FROM golang:1.24-alpine3.21 AS install-dependabot
RUN go install github.com/dependabot/cli/cmd/dependabot@latest \
&& cp $GOPATH/bin/dependabot /usr/local/bin/
FROM docker:28-dind AS runtime
COPY --from=install-dependabot /usr/local/bin/dependabot /usr/local/bin/
ENTRYPOINT ["dependabot"]Then build: docker build -t dependabot-cli:latest.
And run below to run update on local folder:
docker run \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/.docker/config.json:/root/.docker/config.json \
-v $HOME/repos/repo:/repo \
--network=host \
-it \
--rm \
dependabot-cli update pip test/test --local /repoIf there's a better way, pls let me know. 🥺
jasoncodes, Frulfump, Ark-kun, madduci and rafalkrupinski
Metadata
Metadata
Assignees
Labels
No labels