diff --git a/.gitignore b/.gitignore index e90eb86..46afe72 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ NEXTORK.SYS nextor_base.dat *.LST +dist/ diff --git a/README.md b/README.md index 20ad2ac..2c3375f 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,14 @@ There are five makefiles that will take care of building the different component You may want to take a look at [this now closed pull request from Dean Netherton](https://github.com/Konamiman/Nextor/pull/79) that contains a different attempt at writing makefiles for bulding Nextor. It even has some nice extra features like building FDD and HDD images with Nextor, and building the `mknexrom` tool itself. +## How to build Nextor on all platforms with Docker + +Using this method for building Nextor is easier. Everything you need for compiling Nextor already installed in the Docker image. If you have [Docker](https://www.docker.com) installed you can build Nextor on Linux, macOS and Windows, on Arm64 and Intel x86_64 by running the following command: + +```sh +./build_nextor.sh +``` + +After compilation, the `ROM` files will be available in the `dist` directory. + +_Note that the `build_builder.sh` and the content in the `docker` directory are used to create the Docker builder image. You don't need to run them to build Nextor._ diff --git a/build_builder.sh b/build_builder.sh new file mode 100755 index 0000000..42bbc69 --- /dev/null +++ b/build_builder.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# Builds the bulder image from the docker/Dockerfile.builder file for Intel and +# ARM architectures. The image is then pushed to Docker Hub. +# Note that you don't need to run this script for building Nextor ROMs. Only use +# this script if you want to create the builder image yourself. +# +# usage: ./build_builder.sh + +set -e + +# Change the USER and REPO to your Docker Hub username and repository name +USER=gilbertfrancois +REPO=nextor-builder +VERSION=v1.0.0 +IMAGE=${REPO} +BUILDER_CONTAINER_NAME=${REPO}-docker-builder +PLATFORM="linux/amd64,linux/arm64" + +if [[ $(docker container ls -a | grep ${BUILDER_CONTAINER_NAME} | wc -l) -eq 1 ]]; then + echo "Builder container exists, skipping creation." +else + docker buildx create --name ${BUILDER_CONTAINER_NAME} + docker buildx use ${BUILDER_CONTAINER_NAME} + docker buildx inspect --bootstrap +fi +# Create a new builder instance, if not already created +docker buildx build --platform=linux/amd64,linux/arm64 \ + --tag ${USER}/${REPO}:${VERSION} \ + --tag ${USER}/${REPO}:latest \ + -f docker/Dockerfile.builder \ + --push \ + . diff --git a/build_nextor.sh b/build_nextor.sh new file mode 100755 index 0000000..3f60ea3 --- /dev/null +++ b/build_nextor.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Builds the Nextor ROMs using the Docker image gilbertfrancois/nextor-builder:latest +# The ROM artefacts are copied to the dist directory after building. +# +# usage: ./build_nextor.sh + +set -e + +rm -rf dist +mkdir -p dist + +cat <