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 dockerfile #56

Merged
merged 7 commits into from
Jan 12, 2024
Merged

Add dockerfile #56

merged 7 commits into from
Jan 12, 2024

Conversation

kaibocai
Copy link
Member

@kaibocai kaibocai commented Jan 5, 2024

Add dockerfile

@kaibocai kaibocai requested a review from cgillum January 5, 2024 23:24
main.go Outdated
@@ -15,6 +15,7 @@ import (

var (
port = flag.Int("port", 4001, "The server port")
ip = flag.String("ip", "localhost", "The server IP")
Copy link
Member

Choose a reason for hiding this comment

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

I think it's more common to use host as the name of the hostname parameter.

Dockerfile Outdated

# Run
ENTRYPOINT [ "/durabletask-go" ]
CMD [ "--ip", "0.0.0.0" ]
Copy link
Member

Choose a reason for hiding this comment

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

Should we make the port number explicit here too since we're hardcoding EXPOSE 4001?

main.go Outdated Show resolved Hide resolved
Dockerfile Outdated
@@ -0,0 +1,15 @@
# syntax=docker/dockerfile:1

FROM golang:1.21
Copy link
Member

Choose a reason for hiding this comment

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

Please use a multi-stage Dockerfile:

  1. Stage one, from “golang:1.21-alpine” just builds the container
  2. Stage 2 is the production stage and it’s based on distroless.

Example: https://github.com/GoogleContainerTools/distroless/blob/main/examples/go/Dockerfile

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for this! Updated!

Dockerfile Outdated Show resolved Hide resolved
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

I'm good with these changes once @ItalyPaleAle's comments are resolved.

@kaibocai kaibocai merged commit b58abfd into main Jan 12, 2024
4 checks passed
@cgillum cgillum deleted the kaibocai/add-dockerfile branch January 12, 2024 23:27
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.

3 participants