diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bfad5f1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,67 @@ +name: ci-docker +on: + pull_request: + branches: + - master + + # Runs on pushes targeting the default branch + push: + branches: ['master'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + dockerhub-push: + runs-on: ubuntu-latest + environment: DockerHub + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 +# - linux/arm/v7 +# - linux/arm64/v8 +# - linux/ppc64le +# - linux/s390x + + env: + DOCKERHUB_REPONAME: ps3dev + DOCKERHUB_REPOTAG: latest + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: README to Dockerhub + uses: christian-korneck/update-container-description-action@v1 + env: + DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} + with: + destination_container_repo: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPONAME }} + provider: dockerhub + short_description: 'A Docker Image for PS3 Development' + readme_file: 'README.md' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + platforms: ${{ matrix.platform }} + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPONAME }}:${{ env.DOCKERHUB_REPOTAG }} diff --git a/Dockerfile b/Dockerfile index 9f9fe04..510e483 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,50 @@ -FROM debian:12-slim -MAINTAINER Naomi Peori +FROM ubuntu:24.04 -ENV PS3DEV /usr/local/ps3dev -ENV PSL1GHT ${PS3DEV} -ENV PATH ${PATH}:${PS3DEV}/bin:${PS3DEV}/ppu/bin:${PS3DEV}/spu/bin +ENV PS3DEV /usr/local/ps3dev +ENV PSL1GHT $PS3DEV +ENV PATH $PATH:$PS3DEV/bin:$PS3DEV/ppu/bin:$PS3DEV/spu/bin:$PS3DEV/portlibs/ppu/bin +ENV PKG_CONFIG_PATH $PKG_CONFIG_PATH:$PS3DEV/portlibs/ppu/lib/pkgconfig -RUN \ - apt-get -y update && \ - apt-get -y install autoconf bison build-essential flex git libelf-dev libgmp3-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev-is-python3 texinfo wget zlib1g-dev && \ - apt-get -y clean autoclean autoremove && \ - rm -rf /var/lib/{apt,dpkg,cache,log}/ +ENV DEBIAN_FRONTEND noninteractive -RUN \ - git clone https://github.com/ps3dev/ps3toolchain.git && \ - cd ps3toolchain && \ - ./toolchain.sh && \ - cd .. && \ - rm -Rf ps3toolchain +RUN apt update \ + && apt upgrade -y \ + && apt --no-install-recommends install -y \ + autoconf \ + automake \ + bison \ + bzip2 \ + ca-certificates \ + cmake \ + flex \ + gettext-base \ + g++ \ + gcc \ + git \ + libelf-dev \ + libgmp3-dev \ + libncurses5-dev \ + libssl-dev \ + libtool \ + libtool-bin \ + make \ + meson \ + patch \ + pkg-config \ + python-dev-is-python3 \ + texinfo \ + vim \ + wget \ + xz-utils \ + zlib1g-dev \ + # Fixes certificate errors with letsencrypt in ARMv7 + && echo "ca_certificate=/etc/ssl/certs/ca-certificates.crt" >> /etc/wgetrc \ + && echo "check_certificate = off" >> ~/.wgetrc \ + # pass toolchain's check for gmp + && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \ + && git clone https://github.com/humbertodias/ps3toolchain.git /toolchain \ + && /toolchain/toolchain.sh \ + && rm -rf /toolchain WORKDIR /build +CMD ["/bin/bash"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..27ddc89 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +[![ci-docker](https://github.com/humbertodias/ps3dev-docker/actions/workflows/deploy.yml/badge.svg)](https://github.com/humbertodias/ps3dev-docker/actions/workflows/deploy.yml) +[![](https://images.microbadger.com/badges/image/hldtux/ps3dev.svg)](https://microbadger.com/images/hldtux/ps3dev) +[![](https://img.shields.io/docker/pulls/hldtux/ps3dev.svg?maxAge=604800)](https://hub.docker.com/r/hldtux/ps3dev/) + + +## What does this do? + +This program will automatically build a docker image with the ps3dev +toolchain ready to be used for homebrew development. + +## How do I build it? + +Build the image: + +```sh +docker build -t ps3dev-docker . +``` +Copy the helper script: + +``` +cp ps3dev-docker.sh /usr/local/bin +``` +## How do I use it? + + Use the helper script to run 'make' on the current directory: + +``` +ps3dev-docker.sh make +``` +Or, manually run 'make' on the current directory: + +``` +docker run -v `pwd`:/build ps3dev-docker make +``` + +## How do I save and load it? + +Save the image: + +``` +docker save ps3dev-docker | bzip2 > ps3dev-docker.tar.bz2 +``` +Load the image: + +``` +docker load < bzip2 -dc ps3dev-docker.tar.bz2 +``` diff --git a/readme.txt b/readme.txt deleted file mode 100644 index e7e8069..0000000 --- a/readme.txt +++ /dev/null @@ -1,42 +0,0 @@ - ==================== - What does this do? - ==================== - - This program will automatically build a docker image with the ps3dev - toolchain ready to be used for homebrew development. - - ==================== - How do I build it? - ==================== - - Build the image: - - docker build -t ps3dev-docker . - - Copy the helper script: - - cp ps3dev-docker.sh /usr/local/bin - - ================== - How do I use it? - ================== - - Use the helper script to run 'make' on the current directory: - - ps3dev-docker.sh make - - Or, manually run 'make' on the current directory: - - docker run -v `pwd`:/build ps3dev-docker make - - ============================ - How do I save and load it? - ============================ - - Save the image: - - docker save ps3dev-docker | bzip2 > ps3dev-docker.tar.bz2 - - Load the image: - - docker load < bzip2 -dc ps3dev-docker.tar.bz2