Automatically remove the --platform flag from the Dockerfile on deployment#601
Automatically remove the --platform flag from the Dockerfile on deployment#601MicroFish91 merged 9 commits intomainfrom
--platform flag from the Dockerfile on deployment#601Conversation
Can you link said issue? |
|
Here is the open issue on ACR |
| // however, the issues seem to disappear when utilizing the sync version | ||
| tar.c({ cwd: tmpdir(), gzip: true, sync: true, file: context.tarFilePath }, [`@${path.basename(tempTarFilePath)}`]); | ||
|
|
||
| try { |
There was a problem hiding this comment.
Is this try/catch supposed to only be in the if clause? I thought we need to delete the tarFile that we create regardless of the custom logic.
There was a problem hiding this comment.
I believe the tarFile deleting comes in the runStep immediately after.
There was a problem hiding this comment.
In general I have some thoughts about/want some feedback regarding the try/catch structure though. I'll reach out to discuss more offline.
| items = items.filter(i => !vcsIgnoreList.includes(i.name)); | ||
|
|
||
| await tar.c({ cwd: source, gzip: true, file: context.tarFilePath }, items.map(i => path.relative(source, i.fsPath))); | ||
| await this.buildCustomDockerfileIfNecessary(context); |
There was a problem hiding this comment.
Maybe this should be in a the try/catch too? I don't know; if this fails, maybe it's not worth trying the build with their dockerfile anyway?
There was a problem hiding this comment.
There's a few points here that an error could be thrown that I haven't wrapped with try/catch to preserve readability and because I don't necessarily have an elegant solution for error handling in mind. Let's discuss this offline as well
Closes #598
ACR does not support the
--platformflag and will automatically error out if it detects this flag. They have an open issue for it, but we have no idea when it will be addressed and enough people are running into it that we have been asked to help address this on our end.Updated activity log:

Big thanks and credit out to Anthony Chu for helping us come up with the bulk of the core logic for custom Dockerfile replacement! :)