diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index e10cffd..e1a2821 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -2,6 +2,8 @@ name: Build and push Docker image on: push: + branches: + - master pull_request: schedule: - cron: '0 2 * * 0' @@ -14,6 +16,9 @@ env: jobs: main: runs-on: ubuntu-latest + permissions: + contents: read + packages: write strategy: matrix: CPU_ARCH: @@ -39,24 +44,45 @@ jobs: *) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/amd64";; esac docker buildx build -t \ - termux/termux-docker:${{ matrix.CPU_ARCH }} \ + ghcr.io/termux-user-repository/termux-docker:${{ matrix.CPU_ARCH }} \ --platform "$PLATFORM_TAG" \ --build-arg BOOTSTRAP_ARCH=${{ matrix.CPU_ARCH }} \ --build-arg SYSTEM_TYPE="${SYSTEM_TYPE}" \ . - name: Login to Docker Hub - if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker' + if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux-user-repository/termux-docker' uses: docker/login-action@v3 with: - username: grimler - password: ${{ secrets.GRIMLER_DOCKER_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Push to Docker Hub - if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker' + - name: Push + if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux-user-repository/termux-docker' run: | - docker push termux/termux-docker:${{ matrix.CPU_ARCH }} + docker push ghcr.io/termux-user-repository/termux-docker:${{ matrix.CPU_ARCH }} if [ ${{ matrix.CPU_ARCH }} = i686 ]; then - docker tag termux/termux-docker:i686 termux/termux-docker:latest - docker push termux/termux-docker:latest + docker tag ghcr.io/termux-user-repository/termux-docker:i686 ghcr.io/termux-user-repository/termux-docker:latest + docker push ghcr.io/termux-user-repository/termux-docker:latest fi + + - name: Export container as tar archive + if: always() + run: | + docker run \ + --privileged \ + --name termux-docker-${{ matrix.CPU_ARCH }} \ + ghcr.io/termux-user-repository/termux-docker:${{ matrix.CPU_ARCH }} \ + uname -a + docker stop termux-docker-${{ matrix.CPU_ARCH }} + docker export -o termux-docker-${{ matrix.CPU_ARCH }}.tar \ + termux-docker-${{ matrix.CPU_ARCH }} + sha256sum termux-docker-${{ matrix.CPU_ARCH }}.tar + + - name: Store tar archive + if: always() + uses: actions/upload-artifact@v4 + with: + name: termux-docker-${{ matrix.CPU_ARCH }}-${{ github.sha }} + path: termux-docker-${{ matrix.CPU_ARCH }}.tar diff --git a/README.md b/README.md index 0f0b99f..9ba17c5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This will start interactive login shell. Everything will look like in a normal Termux installation. ```.sh -docker run -it termux/termux-docker:latest +docker run -it ghcr.io/termux-user-repository/termux-docker:latest ``` When using the tag `latest`, container will be 32 bit (i686 architecture). @@ -56,13 +56,13 @@ seccomp profile is required. Variant with privileged container: ```.sh -docker run -it --privileged termux/termux-docker:aarch64 +docker run -it --privileged ghcr.io/termux-user-repository/termux-docker:aarch64 ``` Variant with seccomp unconfined profile: ```.sh -docker run -it --security-opt seccomp:unconfined termux/termux-docker:aarch64 +docker run -it --security-opt seccomp:unconfined ghcr.io/termux-user-repository/termux-docker:aarch64 ``` ### Non-interactive execution of commands @@ -73,7 +73,7 @@ command line. Example: ```.sh -docker run -it --rm termux/termux-docker:latest bash -c "apt update && apt install -yq clang" +docker run -it --rm ghcr.io/termux-user-repository/termux-docker:latest bash -c "apt update && apt install -yq clang" ``` ### Root shell @@ -91,7 +91,7 @@ The provided images have 2 entry points: Usage example: ```.sh -docker run -it --entrypoint /entrypoint_root.sh termux/termux-docker:latest +docker run -it --entrypoint /entrypoint_root.sh ghcr.io/termux-user-repository/termux-docker:latest ``` ## Building image @@ -117,4 +117,4 @@ There a number of known issues which may not be resolved: * When running certain multi threaded program in 32bit containers, the PIDs can balloon and easily exceed libc's limit. The only way to fix this is to set - `/proc/sys/kernel/pid_max` to 65535. See [termux-docker#40](https://github.com/termux/termux-docker/issues/40). + `/proc/sys/kernel/pid_max` to 65535. See [termux/termux-docker#40](https://github.com/termux/termux-docker/issues/40). diff --git a/build-all.sh b/build-all.sh index 085f4ab..7b49e0d 100755 --- a/build-all.sh +++ b/build-all.sh @@ -28,19 +28,19 @@ esac for arch in "${ARCHITECTURES[@]}"; do $SUDO $OCI build \ ${OCI_ARG} \ - -t 'termux/termux-docker:'"$arch" \ + -t 'ghcr.io/termux-user-repository/termux-docker:'"$arch" \ -f Dockerfile \ --build-arg BOOTSTRAP_ARCH="$arch" \ --build-arg SYSTEM_TYPE="$SYSTEM_TYPE" \ . if [ "${1-}" = "publish" ]; then - $SUDO $OCI push 'termux/termux-docker:'"$arch" + $SUDO $OCI push 'ghcr.io/termux-user-repository/termux-docker:'"$arch" fi done if [ "$SYSTEM_TYPE" = "x86" ]; then - $SUDO $OCI tag termux/termux-docker:i686 termux/termux-docker:latest + $SUDO $OCI tag ghcr.io/termux-user-repository/termux-docker:i686 ghcr.io/termux-user-repository/termux-docker:latest if [ "${1-}" = "publish" ]; then - $SUDO $OCI push 'termux/termux-docker:latest' + $SUDO $OCI push 'tghcr.io/termux-user-repository/termux-docker:latest' fi fi