Skip to content

[WIP] Add docker & .devcontainer #4319

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

Open
wants to merge 3 commits into
base: feature/foundation
Choose a base branch
from

Conversation

liliankasem
Copy link
Member

  • Add dockerfile + compose to make it easy to build and run the CLI for testing
  • Add .devcontainer to make it easier to setup and contribute to this project

These are initial changes, we can make more as needed.

@liliankasem liliankasem requested a review from a team as a code owner March 19, 2025 00:58
@liliankasem liliankasem force-pushed the liliankasem/new-structure branch from 54c02d6 to 2a670f7 Compare March 20, 2025 00:04
@liliankasem liliankasem requested a review from a team as a code owner March 20, 2025 00:04
Copy link
Contributor

@jviau jviau Mar 20, 2025

Choose a reason for hiding this comment

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

Dotnet SDK has native docker publish integration. Can we use that instead?

https://learn.microsoft.com/en-us/dotnet/core/containers/sdk-publish

Also consider adding a launchProfile for docker, so it will be integrated with both VS and dotnet run: https://learn.microsoft.com/en-us/visualstudio/containers/container-launch-settings?view=vs-2022 -- not sure if this works off of the above docker publish, or needs a docker file separately

Copy link
Member Author

@liliankasem liliankasem Mar 20, 2025

Choose a reason for hiding this comment

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

We can use that, but without a custom dockerfile we don't get a long standing container, and we wont have the components we need installed to create and run dotnet apps (likely the same for other stacks too).

Docker also does a much better job with caching so when you build the image and run it, it takes way less time the second time/or if no changes to the cli.

I'm down to use it in combination with a Dockerfile or something else to configure the image with everything you need to test and validate function apps and cli features, but as a stand alone I am not sold?

Will look into launchProfile.

Edit:

I think maybe the intention of these approaches/images are different. I'm trying to make it so its easy to build, run and test changes you make to the CLI, where as the dotnet container publish is good for just packaging the image itself - so different use case?

Maybe a combo of the dotnet image with .devcontainers = test environment

@@ -11,6 +11,7 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>func</ToolCommandName>
<PackageId>Microsoft.Azure.Functions.CoreTools</PackageId>
Copy link
Member Author

Choose a reason for hiding this comment

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

I'd love to move away from CoreTools and change this to Cli as well

dockerfile: docker/Dockerfile
args:
TARGET_RUNTIME: linux-x64
# platform: linux/amd64 # Uncomment if you are on an M1/M2 Mac
Copy link
Member Author

Choose a reason for hiding this comment

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

Using the apple silicone chips AND trying to run an x64 build. No need for this is running arm64

@liliankasem liliankasem force-pushed the liliankasem/new-structure branch 3 times, most recently from 90b0462 to bd544f8 Compare March 25, 2025 20:22
@liliankasem liliankasem changed the title Add docker & .devcontainer [WIP] Add docker & .devcontainer Mar 25, 2025
Base automatically changed from liliankasem/new-structure to feature/foundation March 25, 2025 22:39
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.

2 participants