From 80d6a989cc4d2112dc90fff94ed285c0f22e2843 Mon Sep 17 00:00:00 2001 From: classabbyamp <5366828+classabbyamp@users.noreply.github.com> Date: Fri, 5 Nov 2021 17:51:46 -0400 Subject: [PATCH] move to new void docker image, clean up dockerfile (#436) Co-authored-by: 0x5c --- Dockerfile | 23 ++++++++++++----------- README-DOCKER.md | 9 ++------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index e51aa71..a0d597d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,19 @@ -FROM voidlinux/voidlinux +FROM ghcr.io/void-linux/void-linux:latest-mini-x86_64 +LABEL org.opencontainers.image.source https://github.com/miaowware/qrm2 COPY . /app WORKDIR /app -ENV PYTHON_BIN python3 +ARG REPOSITORY=https://repo-us.voidlinux.org/current +ARG PKGS="cairo libjpeg-turbo" +ARG UID 1000 +ARG GID 1000 RUN \ - echo "**** update packages ****" && \ - xbps-install -Suy && \ + echo "**** update system ****" && \ + xbps-install -SuyM -R ${REPOSITORY} && \ echo "**** install system packages ****" && \ - export runtime_deps='cairo libjpeg-turbo' && \ - export runtime_pkgs="${runtime_deps} python3-pip python3" && \ - xbps-install -y $runtime_pkgs && \ + xbps-install -yM -R ${REPOSITORY} ${PKGS} python3 python3-pip && \ echo "**** install pip packages ****" && \ pip3 install -U pip setuptools wheel && \ pip3 install -r requirements.txt && \ @@ -21,10 +23,9 @@ RUN \ /tmp/* \ /var/cache/xbps/* -ARG UID -ENV UID=${UID:-1000} -ARG GID -ENV GID=${GID:-1000} +ENV PYTHON_BIN python3 +ENV PYTHONUNBUFFERED 1 + USER $UID:$GID CMD ["/bin/sh", "run.sh", "--pass-errors", "--no-botenv"] diff --git a/README-DOCKER.md b/README-DOCKER.md index 40ab2c9..82e2461 100644 --- a/README-DOCKER.md +++ b/README-DOCKER.md @@ -23,14 +23,11 @@ This is the easiest method for running the bot without any modifications. version: '3' services: qrm2: - image: "docker.pkg.github.com/miaowware/qrm2/qrm2:latest" + image: "ghcr.io/miaowware/qrm2:latest" restart: on-failure volumes: - "./data:/app/data:rw" - environment: - - PYTHONUNBUFFERED=1 ``` - *Note that Github's registry requires [a few extra steps](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages) during the initial setup.* 3. Create a subdirectory named `data`. @@ -64,8 +61,6 @@ This is the easiest method to run the bot with modifications. restart: on-failure volumes: - "./data:/app/data:rw" - environment: - - PYTHONUNBUFFERED=1 ``` 3. Create a subdirectory named `data`. @@ -112,4 +107,4 @@ This methods is not very nice to use. Where `[image]` is either of: - `qrm2:local-latest` if you are building your own. - - `docker.pkg.github.com/miaowware/qrm2/qrm2:latest` if you want to use the prebuilt image. + - `ghcr.io/miaowware/qrm2:latest` if you want to use the prebuilt image.