Skip to content

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

Merged
Samruddhi Khandale (samruddhikhandale) merged 5 commits into
devcontainers:mainfrom
yokonao:add-buildx-cache-to
Jul 31, 2023
Merged

Samruddhi Khandale (samruddhikhandale) merged 5 commits into
devcontainers:mainfrom
yokonao:add-buildx-cache-to

Conversation

@yokonao

Copy link
Copy Markdown
Contributor

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
Nao Yokotsuka (yokonao) requested a review from a team as a code owner June 29, 2023 15:02
@yokonao

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Comment thread src/spec-node/singleContainer.ts Resolved

@joshspicer joshspicer 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.

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

Nao Yokotsuka (yokonao) commented Jun 30, 2023 •

Copy link
Copy Markdown
Contributor Author

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

@yokonao

Copy link
Copy Markdown
Contributor Author

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

joshspicer
joshspicer previously approved these changes Jul 13, 2023

@joshspicer joshspicer 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.

Thanks! I'll ask Christof Marti (@chrmarti) to take a quick peek to

@yokonao

Copy link
Copy Markdown
Contributor Author

Christof Marti (@chrmarti)
Hi! Could you review this PR?

@chrmarti Christof Marti (chrmarti) 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.

Thanks for the PR! Left a comment. Additionally:

Comment thread src/spec-node/singleContainer.ts Resolved
@yokonao

Copy link
Copy Markdown
Contributor Author

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

@chrmarti Christof Marti (chrmarti) 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.

Approving PR, thanks!

joshspicer / Samruddhi Khandale (@samruddhikhandale) Could you take another look? Thanks.

@yokonao

Copy link
Copy Markdown
Contributor Author

Samruddhi Khandale (@samruddhikhandale)
Hi!, Take a look at this PR, please.

@mering

Copy link
Copy Markdown

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

6 participants