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

#1280 Fix Dockerfiles for .NET 6 SDK #1281

Merged
merged 3 commits into from
Oct 25, 2021

Conversation

dpbevin
Copy link
Contributor

@dpbevin dpbevin commented Oct 9, 2021

Fixes #1280

imagePullPolicy: Always
image: <REGISTRY_NAME>/yarp-controller:<TAG>
imagePullPolicy: IfNotPresent
image: yarp/yarp-controller
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this so that I don't have to keep modding the file locally to use it.

Copy link
Member

Choose a reason for hiding this comment

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

Sadly we can't check in a reference to your image here for security reasons

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not publishing any images. This is simply a placeholder name for the local build process. The registry name <REGISTRY_NAME> is invalid, so it needs to be modified when working locally.
yarp could be replaced by anything really: local, donotuse, etc.

Copy link
Member

Choose a reason for hiding this comment

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

I trust you wouldn't, but presumably whoever owns the yarp name could potentially push an image to the repository tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revert that line until yarp publishes official image.

README.md
**/ingress.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prevents unnecessary docker rebuilds when modifying the kube manifests

Copy link
Member

@MihaZupan MihaZupan 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 fixing these up!

COPY ["src/", "src/"]
COPY ["Directory.Build.*", ""]
COPY ["global.json", ""]
COPY ["NuGet.config", ""]
Copy link
Member

Choose a reason for hiding this comment

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

Would it be simpler to copy the entire source folder here? We will only copy the published artifacts regardless

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was attempting to follow this multi-stage approach https://docs.microsoft.com/en-us/visualstudio/containers/container-build?view=vs-2019&WT.mc_id=visualstudio_containers_aka_containerfastmode

But I now realise the Dockerfile doesn't include a nuget package layer. I'll push an update that fixes that.

imagePullPolicy: Always
image: <REGISTRY_NAME>/yarp-controller:<TAG>
imagePullPolicy: IfNotPresent
image: yarp/yarp-controller
Copy link
Member

Choose a reason for hiding this comment

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

Sadly we can't check in a reference to your image here for security reasons

@@ -36,8 +36,8 @@ spec:
spec:
containers:
- name: yarp-proxy
imagePullPolicy: Always
image: <REGISTRY_NAME>/yarp:<TAG>
imagePullPolicy: IfNotPresent
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, what's the significance of changing this policy? Wouldn't a cached image be used if one exists regardless?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Always will first query public feeds (e.g. Docker Hub, ACR, etc.) before checking locally.
When building and deploying locally, it's preferable to check locally first, before falling back to a public feed.

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this mean that if the image on a public feed is updated, you would not see changes locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For repeatability, it is better to choose when to update which versions of images are being run inside your cluster.
This ensures that you "know" exactly what is running inside your cluster. Think secure supply chain, image scanning pipelines, etc.

Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

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

Thanks!

@MihaZupan MihaZupan merged commit d3a185a into microsoft:main Oct 25, 2021
@dpbevin dpbevin deleted the dev/bevo/fixup-dockerfiles branch November 17, 2021 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerfiles not working
2 participants