├── .gitattributes ├── .github └── workflows │ ├── build.yml │ └── release.yml ├── .gitignore ├── Dockerfile ├── README.md ├── docker-compose.yml ├── entrypoint.sh └── install.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build_docker 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build_docker: 9 | name: Docker 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | 15 | - name: replace latest to tag 16 | run: | 17 | sed -i "s/latest/main/g" ./Dockerfile 18 | cat ./Dockerfile 19 | 20 | - name: Docker meta 21 | id: meta 22 | uses: docker/metadata-action@v4 23 | with: 24 | images: xhofe/alist-aria2 25 | 26 | - name: Set up QEMU 27 | uses: docker/setup-qemu-action@v2 28 | 29 | - name: Set up Docker Buildx 30 | uses: docker/setup-buildx-action@v2 31 | 32 | - name: Login to DockerHub 33 | uses: docker/login-action@v2 34 | with: 35 | username: xhofe 36 | password: ${{ secrets.DOCKERHUB_TOKEN }} 37 | 38 | - name: Build and push 39 | id: docker_build 40 | uses: docker/build-push-action@v3 41 | with: 42 | context: . 43 | push: true 44 | tags: ${{ steps.meta.outputs.tags }} 45 | labels: ${{ steps.meta.outputs.labels }} 46 | platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x 47 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release_docker 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | jobs: 9 | release_docker: 10 | name: Docker 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | 16 | - name: replace latest to tag 17 | run: | 18 | sed -i "s/latest/${{ github.ref_name }}/g" ./Dockerfile 19 | cat ./Dockerfile 20 | 21 | - name: Docker meta 22 | id: meta 23 | uses: docker/metadata-action@v4 24 | with: 25 | images: xhofe/alist-aria2 26 | 27 | - name: Set up QEMU 28 | uses: docker/setup-qemu-action@v2 29 | 30 | - name: Set up Docker Buildx 31 | uses: docker/setup-buildx-action@v2 32 | 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v2 35 | with: 36 | username: xhofe 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | 39 | - name: Build and push 40 | id: docker_build 41 | uses: docker/build-push-action@v3 42 | with: 43 | context: . 44 | push: true 45 | tags: ${{ steps.meta.outputs.tags }} 46 | labels: ${{ steps.meta.outputs.labels }} 47 | platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | # 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | 20 | # Go workspace file 21 | go.work 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM xhofe/alist:latest 2 | LABEL MAINTAINER="i@nn.ci" 3 | VOLUME /opt/alist/data/ 4 | WORKDIR /opt/alist/ 5 | COPY entrypoint.sh /entrypoint.sh 6 | COPY install.sh /install.sh 7 | RUN chmod +x /entrypoint.sh /install.sh; \ 8 | /install.sh 9 | 10 | ENV PUID=0 PGID=0 UMASK=022 11 | EXPOSE 5244 6800 12 | ENTRYPOINT [ "/entrypoint.sh" ] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### A docker Image with a pre-installed `aria2` for alist 2 | 3 | #### Usage 4 | 5 | ```bash 6 | docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist-aria2:latest 7 | ``` -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | services: 3 | alist: 4 | restart: always 5 | volumes: 6 | - '/etc/alist:/opt/alist/data' 7 | ports: 8 | - '5244:5244' 9 | environment: 10 | - PUID=0 11 | - PGID=0 12 | - UMASK=022 13 | - TZ=UTC 14 | container_name: alist 15 | image: 'xhofe/alist-aria2:latest' -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown -R ${PUID}:${PGID} /opt/alist/ 3 | 4 | umask ${UMASK} 5 | 6 | exec su-exec ${PUID}:${PGID} nohup aria2c \ 7 | --enable-rpc \ 8 | --rpc-allow-origin-all \ 9 | --conf-path=/root/.aria2/aria2.conf \ 10 | >/dev/null 2>&1 & 11 | 12 | exec su-exec ${PUID}:${PGID} ./alist server --no-prefix 13 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | apk add --no-cache aria2 curl 2 | 3 | mkdir -p /root/.aria2 4 | cd /root/.aria2 5 | wget https://github.com/P3TERX/aria2.conf/archive/refs/heads/master.tar.gz 6 | tar -zxvf master.tar.gz --strip-components=1 7 | rm -rf master.tar.gz 8 | sed -i 's|rpc-secret|#rpc-secret|g' ./aria2.conf 9 | touch /root/.aria2/aria2.session 10 | ./tracker.sh --------------------------------------------------------------------------------