Skip to content

feat: parameterize alpine base images and unify defaults#17

Open
dezhishen wants to merge 3 commits into
OpenListTeam:mainfrom
dezhishen:feat-alpine-parameterization
Open

feat: parameterize alpine base images and unify defaults#17
dezhishen wants to merge 3 commits into
OpenListTeam:mainfrom
dezhishen:feat-alpine-parameterization

Conversation

@dezhishen

@dezhishen dezhishen commented Jun 17, 2026

Copy link
Copy Markdown
Member

增加alpine版本的构建参数(默认3.24)

修改部分参数,便于社区fork后基于fork的仓库开发和调试

fix #16

验证
将主仓库的clone到本地,修改 Dockerfile 文件

### Default image is base. You can add other support by modifying BASE_IMAGE_TAG. The following parameters are supported: base (default), aria2, ffmpeg, aio
ARG BASE_IMAGE_TAG=base

FROM alpine:3.24 AS builder
LABEL stage=go-builder
WORKDIR /app/
RUN apk add --no-cache bash curl jq gcc git go musl-dev
COPY go.mod go.sum ./
RUN go mod download
COPY ./ ./
RUN bash build.sh release docker

FROM dezhishen/openlist-base-image:${BASE_IMAGE_TAG}
LABEL MAINTAINER="OpenList"
ARG INSTALL_FFMPEG=false
ARG INSTALL_ARIA2=false
ARG USER=openlist
ARG UID=1001
ARG GID=1001

WORKDIR /opt/openlist/

RUN addgroup -g ${GID} ${USER} && \
    adduser -D -u ${UID} -G ${USER} ${USER} && \
    mkdir -p /opt/openlist/data

COPY --from=builder --chmod=755 --chown=${UID}:${GID} /app/bin/openlist ./
COPY --chmod=755 --chown=${UID}:${GID} entrypoint.sh /entrypoint.sh

USER ${USER}
RUN /entrypoint.sh version

ENV UMASK=022 RUN_ARIA2=${INSTALL_ARIA2}
VOLUME /opt/openlist/data/
EXPOSE 5244 5245
CMD [ "/entrypoint.sh" ]

构建镜像

docker build . -f Dockerfile -t  openlist:test

运行镜像进行验证

docker run --rm --name test openlist:test

已构建测试镜像: dezhishen/openlist:pull17

docker run --rm --name test dezhishen/openlist:pull17

@dezhishen dezhishen marked this pull request as ready for review June 17, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ARM64 镜像无法启动:/bin/busybox 为空文件,导致 exec format error

1 participant