I have used something like this in the past: FROM alpine:latest AS base # Scratch does not have shell so we have to create non-root user in here and later copy it into scratch. RUN adduser -D -u 123456 appusr FROM scratch # Copy the binary. COPY foo.bin /foo.bin # Copy the user and set is as active. COPY --from=base /etc/passwd /etc/passwd USER appusr # Non-root user cannot bind to "privileged" ports( Simple. But i c…
> i can see ko being good alternative if you for some reason do not want to install docker on your computer The already established good alternative to Docker desktop is Rancher Desktop[1]. [1] https://rancherdesktop.io/
Ko: Easy Go Containers
11–20 of 41 posts
Re: Ko: Easy Go Containers
#12Re: Ko: Easy Go Containers
#13I love `ko`. I wish there was something similar for rust but I haven't found it quite yet
I don't think building something like `ko` with it should be that much work. (I know, famous last words)
I'll have to check with $employer if it's ok to open source it.
Re: Ko: Easy Go Containers
#14I have used something like this in the past: FROM alpine:latest AS base # Scratch does not have shell so we have to create non-root user in here and later copy it into scratch. RUN adduser -D -u 123456 appusr FROM scratch # Copy the binary. COPY foo.bin /foo.bin # Copy the user and set is as active. COPY --from=base /etc/passwd /etc/passwd USER appusr # Non-root user cannot bind to "privileged" ports( Simple. But i c…
I thought that go doesn't work in Alpine because of shared libs?
Re: Ko: Easy Go Containers
#15I have used something like this in the past: FROM alpine:latest AS base # Scratch does not have shell so we have to create non-root user in here and later copy it into scratch. RUN adduser -D -u 123456 appusr FROM scratch # Copy the binary. COPY foo.bin /foo.bin # Copy the user and set is as active. COPY --from=base /etc/passwd /etc/passwd USER appusr # Non-root user cannot bind to "privileged" ports( Simple. But i c…
Not having to run a Docker daemon is just a nice bonus! :)
Re: Ko: Easy Go Containers
#16Ko's simplicity comes from focusing on doing exactly one thing well -- it doesn't have to run containers to build code in any language, it just builds minimal Go containers, and that means it can focus on doing that as well as possible.
Another powerful benefit of focusing on Go (IMO) is that ko can be used to transform a Go importpath to a built image reference.
A common simple use: `docker run $(ko build ./cmd/app)`
This is also how Kubernetes YAML templating[1] works, and it's also how the Terraform provider[2] works -- you give it an importpath, and ko transforms it into a built image reference you can pass to the rest of your config. I don't even "use ko" day-to-day most days, I mostly just use terraform. :)
1: https://ko.build/features/k8s/ 2: https://ko.build/advanced/terraform/
Re: Ko: Easy Go Containers
#17I love `ko`. I wish there was something similar for rust but I haven't found it quite yet
Re: Ko: Easy Go Containers
#18I love `ko`. I wish there was something similar for rust but I haven't found it quite yet
Re: Ko: Easy Go Containers
#19Hey, ko maintainer here! I'd love to answer any questions or hear any feedback folks have. Ko's simplicity comes from focusing on doing exactly one thing well -- it doesn't have to run containers to build code in any language, it just builds minimal Go containers, and that means it can focus on doing that as well as possible. Another powerful benefit of focusing on Go (IMO) is that ko can be used to transform a Go im…
Re: Ko: Easy Go Containers
#20How do you all stay tune of the great apps out there?