gitearmbian/Dockerfile
titor-z faa346ebed armbian-0.1.0
已经经过打包测试的第一版
2024-10-18 16:29:24 +08:00

43 lines
1.3 KiB
Docker
Raw 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"
LABEL maintainer="titor@h2ostudio.cn"
LABEL org.opencontainers.image.created="Thu 17 Oct 2024 05:35:07 PM UTC"
LABEL ORG.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.title="Gitea·Armbian"
LABEL org.opencontainers.image.description ="The Gitea Application on Armbian, Device is Armv7l"
LABEL org.opencontainers.image.created="value"
ENV GITEA_WORK_DIR=/var/lib/gitea
WORKDIR /
COPY debian.sources /etc/apt/sources.list.d
#### 更新包列表并安装必要的依赖
RUN apt-get update && apt-get install -y \
git \
# ca-certificates \
# curl \
# postgresql-client \
# libgit2-dev \
# golang \
&& rm -rf /var/lib/apt/lists/*
#### 复制二进制文件到系统
COPY gitea-1.22.3-linux-arm-6 /usr/local/bin/gitea
COPY gitea.services.sh /etc/init.d/gitea
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" ]