gitearmbian/Dockerfile
2024-10-18 17:51:14 +08:00

39 lines
1.2 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM code.h2ostudio.cn/titor/debian:armv7 AS builder
LABEL Author="titor.Z" maintainer="titor@h2ostudio.cn" org.opencontainers.image.created="Thu 17 Oct 2024 05:35:07 PM UTC" org.opencontainers.image.licenses="MIT" org.opencontainers.image.title="GiteArmBian" org.opencontainers.image.description="专为运行armbian armv7l架构的onecloud开发的Gitea docker镜像"
ENV GITEA_WORK_DIR=/var/lib/gitea
WORKDIR /
# 替换为腾讯源
COPY debian.sources /etc/apt/sources.list.d
# 复制Gitea源码
COPY gitea-1.22.3-linux-arm-6 /usr/local/bin/gitea
# 复制 gitea service 系统服务
COPY gitea.services.sh /etc/init.d/gitea
#### 更新包列表并安装必要的依赖
RUN apt-get update && apt-get install -y \
git \
# ca-certificates \
# curl \
# postgresql-client \
# libgit2-dev \
# golang \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root/
#### 执行初始化操作
###### 1. 创建git用户
###### 2. 创建工作目录
###### 3. 创建Gitea配置文件目录
###### 4. 给移动后的二进制文件赋予任何用户都有的可执行权限
###### 否则会报错git用户将没有权限执行
COPY init.sh .
RUN chmod +x init.sh
EXPOSE 22 3000
VOLUME /var/lib/gitea
ENTRYPOINT [ "./init.sh" ]