#Download and run different architecture of image??

1 messages · Page 1 of 1 (latest)

left bough
#

I'm running Mac (linux/arm64/v8) and like to use GitHubs super-linter (ghcr.io/super-linter/super-linter:latestdocker.io/alpine:latest) in a dagger module, running "dag.container().from_("ghcr.io/super-linter/super-linter:latest")..." but get ge error: "! failed to resolve source metadata for ghcr.io/super-linter/super-linter:latest: no match for platform in manifest: not found". This is due to GitHub don't providing a image version for Mac. Using docker locally I'm able to just add the flag "--platform linux/amd64" and run it anyway... can i achive this in dagger or am I bound to the os version?

woeful edge
left bough
#

When trying the .platform() it returns the platform but how do i use it to set the image i like?

gaunt hornet
#

could you try this and see if it's works ☝️

left bough
#

Thanks... then i get

#

Stderr:
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ Function execution error: Method dagger.client.gen.Client.container() │
│ parameter platform='linux/amd64' was expected to be of type dagger.Platform │
│ | None. │
╰──────────────────────────────────────────────────────────────────────────────╯

#

It looks like i want a typ dagger.Platform... don't know how to add that as input

gaunt hornet
#

sure 👍

You need to first import the type:

import dagger
from dagger import  ... , Platform

Then create a new variable with the platform you want:

linux_amd64 = Platform("linux/amd64")

then you can use it:

dag.container(platform=platform).from_("ghcr.io/super-linter/super-linter:latest").with_exec("xyz").stdout()
#

I'm working on a mac arm and running the code above worked for me @left bough

left bough
#

Thanks @gaunt hornet work awesome 👍🏻

safe fox
#

@gaunt hornet do we have this documented or should I add it to our docs backlog?

gaunt hornet
safe fox
#

I'd like the docs to make use cases first and the language an implementation detail. You have to dig into an SDK to learn what you can do with Dagger. That's counterintuitive