A distroless and rootless container for Alist.
Set up a Alist server with the following command:
This container is designed to be used with Podman. For Docker, we suggest using xhofe/alist.
podman run -d \
--name alist \
--userns=keep-id:uid=65532,gid=65532 \
-v /path/to/save/data:/opt/alist/data \
-p 5244:5244 \
ghcr.io/mogeko/alist:latest
Then, set a password for the admin account:
# Randomly generate a password.
podman exec -it alist /usr/bin/alist admin random
# Set a password manually. Replace NEW_PASSWORD with your password.
podman exec -it alist /usr/bin/alist admin set NEW_PASSWORD
Finally, visit http://localhost:5244 and log in with the admin account.
For more information, please refer to the Alist documentation.
In the consideration of safety, the container runs as a non-root user with UID/GID 65532.
At the same time, as a distroless container, there is not a shell inside the container. Therefore, we cannot use usermod to change the UID/GID of the user inside the container. So we use the --userns option of podman to map the UID/GID of the host to the UID/GID of the user inside the container.
keep-id: creates a user namespace where the current user's UID:GID are mapped to the same values in the container. For containers created by root, the current mapping is created into a new user namespace.
Valid
keep-idoptions:
- uid=UID: override the UID inside the container that is used to map the current user to.
- gid=GID: override the GID inside the container that is used to map the current user to.
Since (as I know) the Docker cannot map the UID/GID of the host to the specified UID/GID of the user inside the container, we suggest using Podman to run this container.
Learn more about distroless container images.
The code in this project is released under the MIT License.
Content type
Image
Digest
sha256:ede51cc96…
Size
25.6 MB
Last updated
about 3 years ago
docker pull mogeko/alist