Skip to content

Commit

Permalink
Simplify Gitea container image (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngarside authored Dec 6, 2024
1 parent f12e18a commit 6980fba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
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

0 comments on commit 6980fba

Please sign in to comment.