redlib-org/redlib

Docker image stuck at version 0.31 and won't build

Kirk1984 opened this issue · 11 comments

Thats pretty much it.

The curl link in the Dockerfile fails.

Im pulling latest tag, but still on 0.31.
And 0.31 is broken. Please fix tyvm! ❤️

Since i arrived at work and being paid for doing nothing :) i whipped up a quick Dockerfile to build a current image:

My finale Dockerfile for local only home use (x64):

FROM rust:bookworm as builder
WORKDIR /app
RUN git clone --depth=1 https://github.com/redlib-org/redlib.git .
RUN cargo build --release

FROM gcr.io/distroless/cc-debian12
COPY --from=builder /app/target/release/redlib /
ENTRYPOINT ["/redlib"]

Just to complete my previous Dockerfile.

You can build your own from the latest commit.

FROM alpine:3.19 AS build
WORKDIR /build
RUN apk add --no-cache git cargo \
 && git clone --depth=1 https://github.com/redlib-org/redlib.git \
 && cd redlib \
 && RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-alpine-linux-musl --target-dir dst \
 && mv dst/x86_64-alpine-linux-musl/release/redlib /usr/local/bin/

FROM alpine:3.19
COPY --from=build /usr/local/bin/redlib /usr/local/bin/
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
USER redlib
EXPOSE 8080
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider -q http://localhost:8080/settings || exit 1
CMD ["redlib"]

Replace x86_64-alpine-linux-musl with aarch64-alpine-linux-musl in case you need a ARM build.
It might take a while so you have to be patient.

@necaran thanks for the Dockerfile, can confirm this works for me. Also, I used alpine:3.20, just FYI.

image size: 16.7 MB

This Dockerfile works with updating the link to the release. There may be some things changing with the release though.

FROM rust:alpine3.19

ARG TARGET

RUN apk add --no-cache curl

RUN (curl -Lo /usr/local/bin/redlib https://github.com/redlib-org/redlib/releases/download/$TARGET/redlib)
RUN chmod +x /usr/local/bin/redlib

RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
USER redlib

# Tell Docker to expose port 8080
EXPOSE 8080

# Run a healthcheck every minute to make sure redlib is functional
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider --q http://localhost:8080/settings || exit 1

CMD ["redlib"]
docker compose build --build-arg TARGET=v0.34.0

I do not know how to use this, same as probably many users. Can the latest tag be fixed pretty please?

I do not know how to use this, same as probably many users. Can the latest tag be fixed pretty please?

for a quick fix get a Dockerfile on your choosing from here, name it Dockerfile and put it int he same folder as the compose file. to build it you can use the compose.dev.yaml from the repo. you can see the build section in there when you compare it the the regular compose.yaml. then just

docker compose build

and when its done

docker compose up -d

I do not know how to use this, same as probably many users. Can the latest tag be fixed pretty please?

for a quick fix get a Dockerfile on your choosing from here, name it Dockerfile and put it int he same folder as the compose file. to build it you can use the compose.dev.yaml from the repo. you can see the build section in there when you compare it the the regular compose.yaml. then just

docker compose build

and when its done

docker compose up -d

Thanks, I managed to do it, but I have a very slow cpu [+] Building 1502.9s (9/9) FINISHED so it took a while.
Now I don't know if I needed to create a volume to be persistent, I don't want to lose this and have to recompile, it kills my cpu and my nas is frozen during compiling.

Anyway, for the creator of the redlib, thank you for your efforts, but please, update the quay link to the latest. I do not understand where the problem is.
It would make my life so much easier.
Thank you.

I do not know how to use this, same as probably many users. Can the latest tag be fixed pretty please?

for a quick fix get a Dockerfile on your choosing from here, name it Dockerfile and put it int he same folder as the compose file. to build it you can use the compose.dev.yaml from the repo. you can see the build section in there when you compare it the the regular compose.yaml. then just
docker compose build
and when its done
docker compose up -d

Thanks, I managed to do it, but I have a very slow cpu [+] Building 1502.9s (9/9) FINISHED so it took a while. Now I don't know if I needed to create a volume to be persistent, I don't want to lose this and have to recompile, it kills my cpu and my nas is frozen during compiling.

Anyway, for the creator of the redlib, thank you for your efforts, but please, update the quay link to the latest. I do not understand where the problem is. It would make my life so much easier. Thank you.

The image is not stored in a volume. If you would run for example “docker image prune” or “docker system prune” your build image would be deleted. I use my forgejo instance to store my build images. Maybe since you are on GitHub you could store it there (never done it myself):

https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages

Thanks, I managed to do it, but I have a very slow cpu [+] Building 1502.9s (9/9) FINISHED so it took a while. Now I don't know if I needed to create a volume to be persistent, I don't want to lose this and have to recompile, it kills my cpu and my nas is frozen during compiling.

Using my Dockerfile won't require it to compile redlib but use the binary on the releases. Would be faster at least, takes about 2 seconds for me to build. But does download the release binary from GitHub.

@rockerBOO - nice, I didn't know that, I used the other image. Will keep in mind.
I see the quay.io repo has been updated for now. I hope we won't be needing this in the future, and all releases would be automatically updated on quay.