Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --cache-to option to devcontainer build command #570

Merged
merged 5 commits into from
Jul 31, 2023

Conversation

yokonao
Copy link
Contributor

@yokonao yokonao commented Jun 29, 2023

Close #563

I added --cache-to option to devcontainer build command.

If buildx is used for building image, we can pass --cache-to option in order to export and reuse buildx cache.

Checks

  • Create docker-container driver builx builder
    • docker buildx create --driver=docker-container --use
  • Build with --cache-to option
    • node devcontainer.js build --workspace-folder . --cache-to=type=local,dest=/tmp/build-cache
  • Confirm cache directory exists
    • ls /tmp/build-cache
❯ ls /tmp/build-cache
blobs  index.json  ingest  oci-layout

@yokonao yokonao requested a review from a team as a code owner June 29, 2023 15:02
@yokonao
Copy link
Contributor Author

yokonao commented Jun 29, 2023

@microsoft-github-policy-service agree

@yokonao yokonao requested a review from joshspicer June 30, 2023 16:24
Copy link
Member

@joshspicer joshspicer left a comment

Choose a reason for hiding this comment

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

I've run CI on your changes and looks like there's a couple minor tweaks needed. Linter issues can be detected locally with yarn lint. There's also a test issue but that probably just needs some minor reworking

@yokonao
Copy link
Contributor Author

yokonao commented Jun 30, 2023

Sorry! I fixed lint issue. Waiting for checks.
I think that tests fails has no association with this PR.

@yokonao yokonao requested a review from joshspicer June 30, 2023 21:53
@devcontainers devcontainers deleted a comment from marketoptiontend Jul 3, 2023
@yokonao
Copy link
Contributor Author

yokonao commented Jul 12, 2023

@joshspicer
Thank you for checking on CI!
What should I do next before merging?

@joshspicer joshspicer requested a review from chrmarti July 13, 2023 18:22
joshspicer
joshspicer previously approved these changes Jul 13, 2023
Copy link
Member

@joshspicer joshspicer left a comment

Choose a reason for hiding this comment

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

Thanks! I'll ask @chrmarti to take a quick peek to

@yokonao
Copy link
Contributor Author

yokonao commented Jul 18, 2023

@chrmarti
Hi! Could you review this PR?

Copy link
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Left a comment. Additionally:

src/spec-node/singleContainer.ts Show resolved Hide resolved
@yokonao
Copy link
Contributor Author

yokonao commented Jul 21, 2023

Thanks for your review. I pushed two commits!

  • check and raise with docker compose file and --cache-to
  • append --cache-to also with an image without a Dockerfile

@yokonao yokonao requested a review from chrmarti July 21, 2023 17:23
Copy link
Contributor

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

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

Approving PR, thanks!

@joshspicer / @samruddhikhandale Could you take another look? Thanks.

@yokonao
Copy link
Contributor Author

yokonao commented Jul 30, 2023

@samruddhikhandale
Hi!, Take a look at this PR, please.

@samruddhikhandale samruddhikhandale merged commit 413c5f7 into devcontainers:main Jul 31, 2023
19 checks passed
@yokonao yokonao deleted the add-buildx-cache-to branch July 31, 2023 23:42
@mering
Copy link

mering commented Oct 23, 2023

This seems to be missing from devcontainer build --help documentation.

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.

Export buildx remote cache when using devcontainer build command
6 participants