#is there any dagger method to install
1 messages · Page 1 of 1 (latest)
Hi @worthy jay , let me know if this guide answers your questions! https://docs.dagger.io/406009/multiplatform-support
what if we use graphql natively and dont use any sdk for this and want to achieve this?
also @worthy jay, if you run the Dagger Engine, via the including a Dagger SDK in your code or via the CLI dagger run the correct architecture of image for the Dagger Engine will be selected from registry.dagger.io .
CLI and SDK releases here: https://github.com/dagger/dagger/releases
Dagger Engine images here: https://github.com/dagger/dagger/pkgs/container/engine (frontended by registry.dagger.io)
I'd get the CLI and use this approach
https://docs.dagger.io/cli/389936/run-pipelines-cli#step-2-create-a-dagger-client-in-bash
but you can use GraphQL from any language potentially. What is your use case?
this image will run dagger automatically on any architecture right? either arm or amd? https://github.com/dagger/dagger/pkgs/container/engine
we are not able to run dagger for both archi amd and arm from one docker image, that's it
@sharp tiger please help when you will be free
The images are architecture-dependent, but the docs that Kyle provided show how to build for multiple architectures.
For example: from my Mac M1 which is arm64 arch, I can run a Dagger Engine (will use the arm CLI and Engine) and use emulation to pull/build container images for other architectures like amd64.
Can you elaborate on this? The image linked is a multiarch image. The container runtime should be able to select the appropriate architecture from the manifest
Facing this error in github action @misty shore
And this is docker file on which we want to run dagger with multi archite in automode
FROM docker:dind
# dagger image
FROM ghcr.io/dagger/engine:main
# Mount Docker socket
VOLUME /var/run/docker.sock
# Set the working directory
WORKDIR /app
# Copy the application files
COPY . /app
# Set the shell
SHELL ["/bin/bash", "-c"]
# Set the entrypoint
ENTRYPOINT ["/bin/bash", "-c"]
LABEL org.opencontainers.image.source https://github.com/StaytunedLLP/github-automation
Ah I understand. I think what you're looking for is docker buildx build instead of docker build when you're building that dockerfile. https://docs.docker.com/engine/reference/commandline/buildx_build/#platform
can you reply me back updated docker file which will work? i wil be so thankful if you can do this
The dockerfile is ok, it's how you build the dockerfile that needs to be changed to create a multiplatform image. The docs I linked for buildx should help
name: docker | dagger-in-docker-amd
on: workflow_dispatch
jobs:
create-image:
runs-on: [self-hosted, pi4b-01]
env:
PACKAGE_NAME: dagger-in-docker-amd
GITHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }}
steps:
- uses: docker/buildx-action@v2
- name: Creating & pushing container image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
echo $GITHUB_TOKEN | docker login ghcr.io -u $DOCKER_USERNAME --password-stdin
docker buildx build --platform linux/amd64,linux/arm64 --push -t ghcr.io/staytunedllp/$PACKAGE_NAME -f dockerfiles/$PACKAGE_NAME.dockerfile .
echo "Image Pushed"
# - name: Pushing container image
# run: |
# docker push ghcr.io/staytunedllp/$PACKAGE_NAME:latest
# echo "Pushed Image"
- name: Getting Detail
run: |
OWNER=$(echo ${{ github.repository }} | cut -d/ -f1)
echo "github_owner=$OWNER" >> $GITHUB_ENV
- name: Deleting older versions of container image
env:
EVENT_TYPE: "delete-old-package-version"
CLIENT_PAYLOAD: '{"package_name": "${{env.PACKAGE_NAME}}","owner": "${{env.github_owner}}"}'
run: |
chmod +x $(pwd)/scripts/build-token.sh
docker run \
-v $(pwd):/app -v /var/run/docker.sock:/var/run/docker.sock \
-e GITHUB_TOKEN="${{env.GITHUB_TOKEN}}" \
-e EVENT_TYPE="${{env.EVENT_TYPE}}" \
-e CLIENT_PAYLOAD='${{env.CLIENT_PAYLOAD}}' \
--rm ghcr.io/staytunedllp/dagger-in-docker-amd:latest \
"dagger run ./scripts/build-token.sh"
is this file ok?
Yeah looks ok at a glance! I'm curious, what's your use case for running dagger-in-docker rather than directly on the github runner?
we dont want to make dependency of installing docker and dagger cli all the time if we change machine for github self hosted runner and we have achieved it, but now facing arm/amd issues if we want to run on github runners, currently its working if we runs on github selfhosted runner on ubuntu pi4b but it's not working in github runner
@misty shore can you help to solve this?
I guess its a bit unique since you're using graphql instead of an sdk so you depend on the dagger cli and that isn't a prerequisite if you're using an sdk. An alternative would be to install the cli in the github workflow instead of prebuilding an image
but it's taking time which is not advisable sometime for instant automations
is it that much more time than pulling the image?
yes self hosted runner can have images from local
makes sense
now please help bro
does the buildx not solve the problem? it will create an image that can be run on either amd64 or arm64
not working in github action to build images for buildx
hey i would like to know if i will use rust sdk then how it will work without cli and i need to compile rust right to execute dagger run?
yes that's one way to do it. Another way would be to package/distribute the precompiled pipeline as a binary
can you share any guide for this with rust?
this command will compile rust first and then execute dagger run right, which may take time based on rust code
dagger run cargo run
yes, but you can also just cargo run. Right now, the dagger cli just provides an improved TUI for your local experience
Some examples linked from the rust sdk here: https://github.com/dagger/dagger/tree/main/sdk/rust
yes but rust code will take time right to compile?
it's non-zero, but in general pipeline code is pretty quick to compile