Compare commits

...

5 Commits

Author SHA1 Message Date
07d4bec762 Base gitea on busybox glibc image
Build gitea from busybox glibc image.
It gets a little smaller (230M instead of 270M).
Added bash, gitea warns if not found.
2026-02-09 12:26:04 +02:00
612cfd8ddd Remove /var/db
We don't need /var/db in leaf containers, and it can grow quite big.
2026-01-25 14:22:53 +02:00
2f14c01c40 Use full image name
Uploaded the image to a private registry.
2026-01-25 14:21:23 +02:00
718f21b04e Add more specific -march 2026-01-25 14:20:57 +02:00
6f8ff6d63c Add -Oz to busybox 2026-01-25 14:19:18 +02:00
8 changed files with 41 additions and 4 deletions

12
Dockerfile.base.busybox Normal file
View File

@@ -0,0 +1,12 @@
# syntax=docker/dockerfile:1
# gentoo-base-busybox
FROM docker.io/gentoo/stage3:nomultilib AS builder
WORKDIR /workdir
COPY --exclude=repos . .
COPY repos /var/db/repos
RUN echo 'FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox"' >> /etc/portage/make.conf
RUN --mount=type=cache,target=/workdir/cache,sharing=locked \
/bin/bash src/bootstrap.sh -u -r /var/db/repos/ceamac -p ceamac:linux/arch/amd64/busybox -m make-docker.conf /mnt/gentoo -j12
CMD ["/bin/sh"]

20
Dockerfile.busybox.gitea Normal file
View File

@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
# gentoo-gitea
FROM gentoo-base-busybox AS builder
WORKDIR /workdir
COPY --exclude=repos --exclude=bin . .
RUN --mount=type=cache,target=/workdir/cache,sharing=locked <<-EOF
echo 'acct-user/git gitea -git' >> /etc/portage/package.use/gitea
emerge -1v --quiet-build=y acct-user/git
/bin/bash src/setup-gitea.sh /mnt/gentoo -j8
EOF
FROM scratch
WORKDIR /
EXPOSE 3000 32799
VOLUME ["/etc/gitea", "/var/lib/gitea"]
COPY --from=builder /mnt/gentoo /
RUN rm -fR /var/db
USER git:git
CMD ["/usr/bin/gitea", "web"]

View File

@@ -15,5 +15,6 @@ WORKDIR /
EXPOSE 3000 32799
VOLUME ["/etc/gitea", "/var/lib/gitea"]
COPY --from=builder /mnt/gentoo /
RUN rm -fR /var/db
USER git:git
CMD ["/usr/bin/gitea", "web"]

View File

@@ -7,4 +7,5 @@ RUN bin/gentoo-emerge -1c --with-bdeps=n
FROM scratch
WORKDIR /
COPY --from=builder /mnt/gentoo /
RUN rm -fR /var/db
CMD ["/bin/bash"]

View File

@@ -1,6 +1,6 @@
services:
gitea:
image: gentoo-gitea
image: registry.ceamac.ro/gentoo-gitea
restart: always
#user: 196:196
userns: nomap

View File

@@ -1,4 +1,4 @@
COMMON_FLAGS="-O2 -pipe"
COMMON_FLAGS="-O2 -pipe -march=x86-64-v3"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"

View File

@@ -77,6 +77,9 @@ mkdir -p "${imageroot}"/var/db/repos
mkdir -p "${imageroot}"/var/tmp
[[ -e ${makeconf} ]] && cp "${makeconf}" "${imageroot}"/etc/portage/make.conf
mkdir -p "${imageroot}"/etc/portage/env/sys-apps
echo 'CFLAGS="${CFLAGS} -Oz"' >> "${imageroot}"/etc/portage/env/sys-apps/busybox
# addrepoconfs [root]
addrepoconfs() {
repoconf="${imageroot}"/etc/portage/repos.conf/gentoo.conf

View File

@@ -8,7 +8,7 @@ imagename="$(basename "${imagedir}")"
shift
usename="${imagedir}"/etc/portage/package.use
[[ -d ${usename} ]] && usename="${usename}"/php.conf
[[ -d ${usename} ]] && usename="${usename}"/gitea.conf
cat <<-EOF >> "${usename}"
*/* cxx
@@ -21,7 +21,7 @@ dev-vcs/git -perl
sys-apps/shadow su
EOF
bin/"${imagename}"-emerge -vk "$@" gitea dev-vcs/git-lfs
bin/"${imagename}"-emerge -vk "$@" www-apps/gitea dev-vcs/git-lfs app-shells/bash
bin/"${imagename}"-emerge -1vuDUk "$@" @world
bin/"${imagename}"-emerge -1c --with-bdeps=n "$@"