Skip to content

Fix dockerfile - #2288

Merged
marcosnils merged 2 commits into
dagger:mainfrom
crazy-max:fix-dockerfile
Apr 25, 2022
Merged

marcosnils merged 2 commits into
dagger:mainfrom
crazy-max:fix-dockerfile

Conversation

@crazy-max

@crazy-max crazy-max commented Apr 23, 2022 •

Copy link
Copy Markdown
Contributor

Encounter this issue while building Dagger from source for our GitHub Action in dagger/dagger-for-github#53

  #10 8.698 go: downloading github.com/klauspost/compress v1.15.1
  #10 8.699 go: downloading github.com/containerd/ttrpc v1.1.0
  #10 9.890 go: missing Git command. See https://golang.org/s/gogetcmd
  #10 9.891 error obtaining VCS status: exec: "git": executable file not found in $PATH
  #10 9.891 	Use -buildvcs=false to disable VCS stamping.
  #10 ERROR: executor failed running [/bin/sh -c CGO_ENABLED=0 go build -o /out/dagger -ldflags '-s -d -w' ./cmd/dagger;     file /out/dagger | grep "statically linked"]: exit code: 1

https://github.com/dagger/dagger-for-github/runs/6136917852?check_suite_focus=true#step:3:479

This PR adds git package to fix this issue. We could also disable buildvcs if you want.

Also adds an action in our ci plan to check this Dockerfile builds correctly.

Signed-off-by: CrazyMax <[email protected]>
@crazy-max
crazy-max requested a review from a team as a code owner April 23, 2022 11:25
@crazy-max
crazy-max requested review from gerhard and shykes April 23, 2022 11:25
@crazy-max
crazy-max force-pushed the fix-dockerfile branch 2 times, most recently from d1e32a6 to 6b675b4 Compare April 23, 2022 11:44

@marcosnils marcosnils left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! left a small nit

Comment thread ci.cue Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ignore the website folder here? it's a big one and we're sending it to the context unnecessarily

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to hack around filesystem as it seems we can't inherit from another one so I have created a filesystem to build the docker image named ./. This way it doesn't overlap with the main one called . but that looks hacky to me.

before

11:47AM INF actions.build.docker | completed    duration=2m1.1s

after

3:53PM INF actions.build.docker | completed    duration=1m45.9s

Would be better if we could specify an id for a filesystem or better inherit from an existing one to override some attributes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better if we could specify an id for a filesystem or better inherit from an existing one to override some attributes.

You can use docker.#Copy to create a new FS with the things you want to include or exclude. I think doing a copy vs creating a new FS should be more performant

@crazy-max crazy-max Apr 25, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use docker.#Copy to create a new FS with the things you want to include or exclude. I think doing a copy vs creating a new FS should be more performant

iiuc it will build two images? First one that will just create an FS with just a docker.#Copy step and the core.#Dockerfile will use this FS to build its image? That sounds worse no?

Maybe we should discuss and make this change in a follow-up as it seems out of scope with this PR. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iiuc it will build two images? First one that will just create an FS with just a docker.#Copy step and the core.#Dockerfile will use this FS to build its image? That sounds worse no?

Correct. I meant core.#Copy which don't produce an #Image but a new dagger.#FS

@crazy-max
crazy-max force-pushed the fix-dockerfile branch 5 times, most recently from b3cc48a to e1b9966 Compare April 23, 2022 16:12
@crazy-max

crazy-max commented Apr 23, 2022 •

Copy link
Copy Markdown
Contributor Author

Argh looks like we are rate-limited by GitHub: https://github.com/dagger/dagger/runs/6141045840?check_suite_focus=true#step:6:1178

 3:56PM DBG system | #27 writing layer sha256:1cdedcb54f31f70eb8fa1ff866c61f3c5a2e484caa4570cea14935ae2dd731a9
3:56PM DBG system | #27 writing layer sha256:1cdedcb54f31f70eb8fa1ff866c61f3c5a2e484caa4570cea14935ae2dd731a9 0.6s done
4:01PM DBG system | #27 ERROR: maximum timeout reached

Looks similar to moby/buildkit#2804

@aluzzardi

Copy link
Copy Markdown
Contributor

Argh looks like we are rate-limited by GitHub: https://github.com/dagger/dagger/runs/6141045840?check_suite_focus=true#step:6:1178

Yes. Noticing more and more PRs are being affected by this.

I've just restarted the CI

@marcosnils
marcosnils merged commit 08c923a into dagger:main Apr 25, 2022
@crazy-max
crazy-max deleted the fix-dockerfile branch April 25, 2022 19:12
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