Live data from Hacker News

Ko: Easy Go Containers

ko.build

1–10 of 41 posts

Re: Ko: Easy Go Containers

#2
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 can see ko being good alternative if you for some reason do not want to install docker on your computer but still be able to build docker containers.

Re: Ko: Easy Go Containers

#3
post #2

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/

Re: Ko: Easy Go Containers

#4
post #2

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/

This is not talking so much about the Docker GUI things but rather this doesn't require a Docker daemon at all.

Similar tools are Google's Jib for JVM based applications, `rules_docker` and `rules_oci` for Bazel etc.

All of which allow you to build applications without needing a Docker runtime at all during the build process which is a huge plus for portability, performance and repeatability.

Re: Ko: Easy Go Containers

#7
post #2

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/

https://podman-desktop.io/

Re: Ko: Easy Go Containers

#8
post #7

Earlier quoted context omitted.

> 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/

https://podman-desktop.io/

https://orbstack.dev/

Re: Ko: Easy Go Containers

#9
post #2

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 thought that go doesn't work in Alpine because of shared libs?

Re: Ko: Easy Go Containers

#10
post #7

Earlier quoted context omitted.

> 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/

https://podman-desktop.io/

From my experience, podman desktop is pretty good at containers, but horrible for Kubernetes (it uses KIND but you can't configure basic things, like exposing NodePort IIRC).

Given that SUSE uses Podman, I hope they'll modify Rancher Desktop to use Podman, in which case it'd supersede Podman Desktop.

Post reply on HN