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

Simplify Gitea container image #54

Merged
merged 8 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions gitea/containerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# This is free and unencumbered software released into the public domain.

FROM docker.io/gitea/gitea:latest AS build
FROM docker.io/alpine:latest AS build

FROM docker.io/alpine:latest
RUN apk add git

RUN apk add gitea
# gitea --version | grep -oE [0-9]+.[0-9]+.[0-9]+
RUN wget -O gitea https://dl.gitea.com/gitea/1.22.4/gitea-1.22.4-linux-amd64
RUN chmod +x gitea

FROM scratch

COPY --from=build /gitea /usr/bin/gitea

COPY --from=build /usr/bin/git /usr/bin/git

COPY --from=build /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1

COPY --from=build /usr/lib/libpcre2-8.so.0 /usr/lib/libpcre2-8.so.0

COPY --from=build /usr/lib/libz.so.1 /usr/lib/libz.so.1

COPY --from=build /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1

ENV GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT=true

ENTRYPOINT ["/usr/bin/gitea"]
EXPOSE 80

EXPOSE 3000
ENTRYPOINT ["/usr/bin/gitea"]

CMD [ \
"--config", "/opt/gitea/app.ini" \
]
CMD ["web", "--config", "/opt/gitea/app.ini", "--port", "80"]
2 changes: 1 addition & 1 deletion gitea/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
docker build --file containerfile --tag ghcr.io/ngarside/gitea:latest .

run: stop
docker run --detach --name gitea --publish 8080:3000 --read-only --rm --volume {{ replace(justfile_directory(), '\', '/') }}/bin/opt:/opt/gitea --volume {{ replace(justfile_directory(), '\', '/') }}/bin/root:/root ghcr.io/ngarside/gitea:latest
docker run --detach --name gitea --publish 8080:80 --read-only --rm --volume {{ replace(justfile_directory(), '\', '/') }}/bin/opt:/opt/gitea --volume {{ replace(justfile_directory(), '\', '/') }}/bin/root:/root --volume {{ replace(justfile_directory(), '\', '/') }}/bin/tmp:/tmp ghcr.io/ngarside/gitea:latest

stop:
docker stop gitea || true
6 changes: 6 additions & 0 deletions scripts/alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# This is free and unencumbered software released into the public domain.

set -euo pipefail

docker run --interactive --rm --tty alpine /bin/sh
Loading