@bender@twtxt.net I built my own, a much smaller one with a multi stage build… shouldn’t that do the trick? 🤔
P.S:
~/remote/htwtxt » podman image list htwtxt the@wks
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/htwtxt 1.0.5-alpine 13610a37e347 3 hours ago 20.1 MB
localhost/htwtxt 1.0.7-alpine 2a5c560ee6b7 3 hours ago 20.1 MB
docker.io/buckket/htwtxt latest c0e33b2913c6 8 years ago 778 MB
@aelaraji@aelaraji.com wow, the difference in size is astonishing! What your Dockerfile looks like?
@bender@twtxt.net here:
FROM golang:alpine as builder
ARG version
ENV HTWTXT_VERSION=$version
WORKDIR $GOPATH/pkg/
RUN wget -O htwtxt.tar.gz https://github.com/plomlompom/htwtxt/archive/refs/tags/${HTWTXT_VERSION}.tar.gz
RUN tar xf htwtxt.tar.gz && cd htwtxt-${HTWTXT_VERSION} && go mod init htwtxt && go mod tidy && go install htwtxt
FROM alpine
ARG version
ENV HTWTXT_VERSION=$version
RUN mkdir -p /srv/htwtxt
COPY --from=builder /go/bin/htwtxt /usr/bin/
COPY --from=builder /go/pkg/htwtxt-${HTWTXT_VERSION}/templates/* /srv/htwtxt/templates/
WORKDIR /srv/htwtxt
VOLUME /srv/htwtxt
EXPOSE 8000
ENTRYPOINT ["htwtxt", "-dir", "/srv/htwtxt", "-templates", "/srv/htwtxt/templates"]
Don’t forget the --build-arg version="1.0.7"
for example when building this one, although there isn’t much difference between the couple last versions.
P.S: I may have effed up changing htwtxt’s files directory to /srv/htwtxt
when the command itself defaults to /root/htwtxt
so you’ll have to throw in a -dir whenever you issue an htwtxt command (i.e: htwtxt -adduser somename:somepwd -dir /srv/htwtxt
… etc)
@aelaraji@aelaraji.com I often wish “like” was a thing here. I would have just giving it one to this twtxt, and a re-post, to boost. :-) Thank you!
@bender@twtxt.net Glad you could find it useful … as for like
I’m glad they’re not a thing here xD otherwise we wouldn’t be having as much conversations going on in here. but I get it, and do appreciate it. 🙏
@bender@twtxt.net Dud! you should see the updated version! 😂 I have just discovered the scratch
#container image and decided I wanted to play with it… I’m probably going to end up rebuilding a LOT of images.
~/htwtxt » podman image list htwtxt
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/htwtxt 1.0.7-scratch 2d5c6fb7862f About a minute ago 12 MB
localhost/htwtxt 1.0.5-alpine 13610a37e347 4 weeks ago 20.1 MB
localhost/htwtxt 1.0.7-alpine 2a5c560ee6b7 4 weeks ago 20.1 MB
docker.io/buckket/htwtxt latest c0e33b2913c6 8 years ago 778 MB
@aelaraji@aelaraji.com Yes building OCI images with no userland to speak of is great isn’t it 🤣
As long as you can correctly statically link your binary of course 🤣