Skip to content

Latest commit

 

History

History
112 lines (75 loc) · 4.76 KB

DOCKER.md

File metadata and controls

112 lines (75 loc) · 4.76 KB

Open Orbis Toolchain Dockerfile

Synopsis

The Open Orbis team has put together a Dockerfile to make compiling PKGs with the Open Orbis PS4 Toolchain trivial to do. This makes updating the toolchain simple, stops the environment from becoming contaminated (or contaminating another environment), minimizes the troubleshooting needed for issues, enables building with a particular version, etc. This document is aimed at providing an overview of how to use the Dockerfile to make a developer's life easier. There are multiple methods that can be utilized depending on the developer's individual need at any given time.

Methods

The most common use case for each method is as follows:

  • Single Line Build: You are building a PKG file on your local machine.
  • Github Actions: Used to check pull requests, generate releases, etc on Github without needing user interaction.
  • CLI Access: Testing, debugging, etc.

Single Line Build

Windows:

docker run -w /build -v "%cd%":/build openorbis/toolchain:latest make

Linux/OSX/BSD:

docker run -w /build -v "$(pwd)":/build openorbis/toolchain:latest make

This one-liner will run the make command from your current working directory as if it were on a machine with the latest Open Orbis Toolchain installed and working as expected. You can use this to launch a custom script as necessary. See the Build Script section for some caveats.

Github Actions

The following action will use the Open Orbis Toolchain v0.5 to run make in the projects hello_world directory, then use pkg/pkg.gp4 to build a PKG file.

- name: Run Open Orbis Toolchain
        uses: OpenOrbis/toolchain-action@main
        with:
          version: v0.5
          command: cd hello_world; make; PkgTool.Core pkg/pkg.gp4 .

You could also run the build script action.sh from the projects root directory with the latest Open Orbis Toolchain release with the following action:

- name: Run Open Orbis Toolchain
        uses: OpenOrbis/toolchain-action@main
        with:
          version: latest
          command: bash action.sh

CLI Access

You can open an interactive shell within the container with the following command:

Windows:

docker run -it --entrypoint=/bin/sh -v "%cd%":/build openorbis/toolchain

Linux/OSX/BSD:

docker run -it --entrypoint=/bin/sh -v "$(pwd)":/build openorbis/toolchain

Note: In the above commands only changes made in the /build directory will remain as it is the mounted directory and is actually on the host machine.

Docker

To use the "CLI Access" and "Single Line Build" method you must have Docker installed locally.

Build Script

Some notes to keep in mind:

  • This is a minimal Ubuntu 20.04 installation. You'll need to install other applications as necessary
  • The working directory will be the repo's root directory
  • Use relative paths for locations within the repo's directory
  • ANY error should stop the Github Action immediately

Other Tips

  • It is possible to specify why Toolchain version to use by specifying the version in the commands. ex. openorbis/toolchain:v0.5, you can also use latest to use the most recent build.
  • docker pull openorbis/toolchain will update your Docker container to the latest release or docker pull openorbis/toolchain:v0.5 to pull a specific version's update.
  • Always pull the new container's data before deleting old containers as there may be overlap/cached data and will save you download time

Docker Development

The development of the Dockerfile and this document file can be found here. This repo uses Github Actions to build and publish the Docker container to Docker Hub automatically on releases. The workflow file can be found here. The Github Action for the toolchain can be found here.

Additional Support

Additional support will be provided in the Open Orbis Discord server.