to give context. I set up an action to lint markdown files. And I want to use it in 2 different contexts:
- on my personal project
- on my company project
But I have a constraint in my company. I can't use the docker images from the docker hub. They have set up a mirror with their own images.
Here are my action:
package markdown
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
#Lint: {
// source code
source: dagger.#FS
// mardownlint version
version: *"0.31.1" | string
// Files to lint
files: [...string]
_image: docker.#Pull & {
source: "tmknom/markdownlint:\(version)"
}
docker.#Run & {
input: *_image.output | _
mounts: "source": {
dest: "/src"
contents: source
}
workdir: "/src"
command: {
name: "markdownlint"
args: files
}
}
}
on my personal project, I do this:
"markdown": markdown.#Lint & {
source: _source.output
files: ["README.md"]
}
and it's works perfectly. In my company project, I must use a private image. So I do this:
_image: {
markdownlint: docker.#Pull & {
source: "\(_#DefaultAwsAccount).dkr.ecr.\(_#DefaultAwsRegion).amazonaws.com/public/tmknom/markdownlint:0.31.1"
auth: {
username: "AWS"
secret: client.commands.ecrPassword.stdout
}
}
}
// ...
"markdown": markdown.#Lint & {
input: _image.markdownlint.output
source: _source.output
files: ["README.md"]
}
it also works. But when you get to the CI server, it doesn't work. I took a closer look, and I realized that my Action was 2 docker pull.
it doesn't work because I can't get the public image, it's blocked in DNSit doesn't work because I can't get the public image, it's blocked in DNS. But normally, dagger should not try to pull this image? because I don't use it after, it's override.