Compare commits

...

73 Commits
v43 ... master

Author SHA1 Message Date
Héctor Molinero Fernández
1dbbeb4fbd Add volume option to example command, fixes #12 2024-08-17 17:08:15 +02:00
Héctor Molinero Fernández
cb8849fc1e Add note about KVM option, fixes #14 2024-08-17 17:02:53 +02:00
Héctor Molinero Fernández
38c0c79d76 Update base image to Ubuntu 24.04 2024-07-26 23:28:56 +02:00
Héctor Molinero Fernández
3e78cb0215 Create /run/samba/ 2024-07-26 23:26:15 +02:00
Héctor Molinero Fernández
1a91d57625 Update ReactOS to v0.4.14-119 2024-07-20 17:28:59 +02:00
Héctor Molinero Fernández
5028c72619 Update BusyBox to 5398-g89ae34445 2024-07-20 17:28:38 +02:00
Héctor Molinero Fernández
a5d152ae24 Update Websockify to v0.12.0 2024-07-20 17:27:57 +02:00
Héctor Molinero Fernández
3d5f2b942b Update noVNC to v1.5.0 2024-07-20 17:22:53 +02:00
Héctor Molinero Fernández
af641b071b Do not copy QEMU user binary 2024-07-20 16:39:26 +02:00
Héctor Molinero Fernández
d602925a09 Use "hectorm/ghaction-release" action 2024-07-20 15:40:34 +02:00
Héctor Molinero Fernández
efd183861a Use "hectorm/ghaction-trigger-workflow" action 2024-07-20 14:52:20 +02:00
Héctor Molinero Fernández
4623b1e3c9 Update Dependabot config 2024-07-20 12:50:58 +02:00
Héctor Molinero Fernández
ae82178446 Reformat GitHub YAML files 2024-07-20 11:58:32 +02:00
Héctor Molinero Fernández
b6551ba201 v57 2024-04-04 23:29:39 +02:00
Héctor Molinero Fernández
e11cb75fe7 Update ReactOS to v0.4.14-104 2024-04-04 23:28:39 +02:00
Héctor Molinero Fernández
4bba179967 Update BusyBox to 5301-gda71f7c57 2024-04-04 23:28:23 +02:00
Héctor Molinero Fernández
26879a25d1 Preserve credentials of binfmt binary 2024-01-22 20:29:00 +01:00
Héctor Molinero Fernández
eac2b07c5e Use the native platform in the build stage 2024-01-22 19:40:09 +01:00
Héctor Molinero Fernández
f7f18c3d79 Update ReactOS to v0.4.14-98 2024-01-21 18:03:45 +01:00
Héctor Molinero Fernández
36e571bc18 Use ${branch}-dirty as image tag when repository is not clean 2024-01-21 17:51:06 +01:00
Héctor Molinero Fernández
6f8992051c Set platform during build and register binfmt interpreters in memory 2024-01-21 17:36:26 +01:00
Héctor Molinero Fernández
21b6e9e4a1
Merge pull request #10 from hectorm/dependabot/github_actions/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4
2023-12-18 20:38:30 +01:00
Héctor Molinero Fernández
7ac900a3a6
Merge pull request #11 from hectorm/dependabot/github_actions/actions/download-artifact-4
Bump actions/download-artifact from 3 to 4
2023-12-18 20:38:22 +01:00
dependabot[bot]
7efa177e18
Bump actions/download-artifact from 3 to 4
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 00:57:13 +00:00
dependabot[bot]
f8989d290c
Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 00:57:09 +00:00
Héctor Molinero Fernández
cab0ceab3d v56 2023-10-22 17:02:04 +02:00
Héctor Molinero Fernández
77a3b127f1 Update ReactOS to v0.4.14-94 2023-10-22 16:32:45 +02:00
Héctor Molinero Fernández
883b7e28e6 Update BusyBox to 5181-g5c1a3b00e 2023-10-22 16:32:30 +02:00
Héctor Molinero Fernández
e6ca925a94
Merge pull request #9 from hectorm/dependabot/github_actions/docker/login-action-3
Bump docker/login-action from 2 to 3
2023-09-18 21:23:39 +02:00
dependabot[bot]
a6b0870176
Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 00:04:49 +00:00
Héctor Molinero Fernández
d08e483047
Merge pull request #8 from hectorm/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-12 22:53:30 +02:00
dependabot[bot]
02047beb30
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 00:26:00 +00:00
Héctor Molinero Fernández
98a95a37ae v55 2023-04-16 14:00:22 +02:00
Héctor Molinero Fernández
dfe8ce097f Update ReactOS to v0.4.14-69 2023-04-16 13:47:39 +02:00
Héctor Molinero Fernández
f726ef51ca Update BusyBox to 4882-g6e0a6b7e5 2023-04-16 13:47:02 +02:00
Héctor Molinero Fernández
9518cdb808 v54 2023-03-16 20:22:39 +01:00
Héctor Molinero Fernández
b8e1431fdd Update ReactOS to v0.4.14-61 2023-03-16 20:10:20 +01:00
Héctor Molinero Fernández
8d2b773d50 v53 2023-01-29 13:08:48 +01:00
Héctor Molinero Fernández
114e5186cc Set timeout in netcat 2023-01-29 13:07:35 +01:00
Héctor Molinero Fernández
aca7de648f v52 2023-01-25 18:29:52 +01:00
Héctor Molinero Fernández
af4005ca28 Update noVNC to v1.4.0 2023-01-25 18:29:09 +01:00
Héctor Molinero Fernández
aec1c68eee Update ReactOS to v0.4.14-47 2023-01-25 18:28:52 +01:00
Héctor Molinero Fernández
f24db90bce Remove year from license 2023-01-19 00:09:20 +01:00
Héctor Molinero Fernández
2f5f595298 v51 2023-01-09 23:32:11 +01:00
Héctor Molinero Fernández
d08fa35863 Update ReactOS to v0.4.14-44 2023-01-09 21:39:59 +01:00
Héctor Molinero Fernández
823e89db2a v50 2022-12-16 18:51:59 +01:00
Héctor Molinero Fernández
764f04253b Update BusyBox to 4784-g5507c8744 2022-12-16 18:38:28 +01:00
Héctor Molinero Fernández
2885573d11 Update Websockify to v0.11.0 2022-12-16 18:35:32 +01:00
Héctor Molinero Fernández
2c1d0324ff v49 2022-12-15 00:20:34 +01:00
Héctor Molinero Fernández
f6b8463bfa Update ReactOS to v0.4.14-36 2022-12-15 00:18:20 +01:00
Héctor Molinero Fernández
d909ccd1ef v48 2022-10-07 00:57:45 +02:00
Héctor Molinero Fernández
4dee4565b3 Updated ReactOS to v0.4.14-23 2022-10-07 00:49:19 +02:00
Héctor Molinero Fernández
2d1ecf4c4d v47 2022-08-19 14:55:48 +02:00
Héctor Molinero Fernández
40e20bd753 Switch from tini to catatonit 2022-08-19 14:43:40 +02:00
Héctor Molinero Fernández
5ce4479549 Run workflow with ubuntu-latest 2022-07-17 12:23:50 +02:00
Héctor Molinero Fernández
6bf0444e8f v46 2022-06-18 15:19:27 +02:00
Héctor Molinero Fernández
97ae8b86a9 Explicitly define network configuration and remove guestfwd option 2022-06-18 14:09:44 +02:00
Héctor Molinero Fernández
d6ce907a7a v45 2022-06-15 00:29:52 +02:00
Héctor Molinero Fernández
daffd49dac Update readme 2022-06-14 23:58:05 +02:00
Héctor Molinero Fernández
4659e2b9da Update BusyBox to 4487-gd239d2d52 2022-06-14 23:54:13 +02:00
Héctor Molinero Fernández
20808cf8a5 Remove arm32v7 architecture 2022-06-14 23:48:02 +02:00
Héctor Molinero Fernández
2f8f43e6f7 Build common stages separately 2022-06-14 23:45:37 +02:00
Héctor Molinero Fernández
d3bb0c7b75 Update base image to Ubuntu 22.04 2022-06-14 23:45:22 +02:00
Héctor Molinero Fernández
9bc4cbe849 Explicitly define global permissions for the GitHub token 2022-05-21 17:27:29 +02:00
Héctor Molinero Fernández
2e3431c0ae Modified Dependabot interval from daily to weekly 2022-05-21 17:02:42 +02:00
Héctor Molinero Fernández
cd9efa505c
Merge pull request #7 from hectorm/dependabot/github_actions/docker/login-action-2
Bump docker/login-action from 1 to 2
2022-05-06 16:05:50 +02:00
dependabot[bot]
f25b06b04c
Bump docker/login-action from 1 to 2
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 00:54:41 +00:00
Héctor Molinero Fernández
ebaac7cb34 v44 2022-04-28 23:21:20 +02:00
Héctor Molinero Fernández
24337c3892 Do not upload native artifact 2022-04-28 22:57:59 +02:00
Héctor Molinero Fernández
526a0afb0d Use environment variable instead of context 2022-04-28 22:38:50 +02:00
Héctor Molinero Fernández
4b18db3c42 Use environment variable instead of context 2022-04-28 21:44:53 +02:00
Héctor Molinero Fernández
bf8bcd369c Use environment variable instead of context 2022-04-28 21:32:29 +02:00
Héctor Molinero Fernández
407a6d48a8 Removed unnecessary cat 2022-04-28 21:08:08 +02:00
10 changed files with 173 additions and 174 deletions

View File

@ -1,8 +1,19 @@
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
version: 2

updates:

- package-ecosystem: 'github-actions'
directory: '/'
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: 'daily'
interval: "weekly"
groups:
docker-all:
patterns: ["*"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions-all:
patterns: ["*"]

View File

@ -1,110 +1,134 @@
name: 'Main'
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Main"

on:
push:
tags: ['*']
branches: ['*']
tags: ["*"]
branches: ["*"]
pull_request:
branches: ['*']
branches: ["*"]
workflow_dispatch:

jobs:
permissions: {}

build:
name: 'Build ${{ matrix.arch }} image'
runs-on: 'ubuntu-latest'
jobs:
build-common-stages:
name: "Build common stages"
runs-on: "ubuntu-latest"
permissions:
contents: 'read'
contents: "read"
strategy:
matrix:
arch: ['native', 'amd64', 'arm64v8', 'arm32v7']
stage: ["build"]
steps:
- name: 'Checkout project'
uses: 'actions/checkout@v3'
- name: 'Register binfmt entries'
- name: "Checkout project"
uses: "actions/checkout@v4"
- name: "Build and save image"
run: |
make \
IMAGE_REGISTRY="localhost" IMAGE_NAMESPACE="stage" IMAGE_PROJECT="${{ matrix.stage }}" \
IMAGE_BUILD_OPTS="--pull --target ${{ matrix.stage }} --build-arg BUILDKIT_INLINE_CACHE=1" \
build-native-image save-native-image
- name: "Upload artifacts"
uses: "actions/upload-artifact@v4"
with:
name: "dist-common-stages"
path: "./dist/"
retention-days: 1

build:
name: "Build ${{ matrix.arch }} image"
needs: ["build-common-stages"]
runs-on: "ubuntu-latest"
permissions:
contents: "read"
strategy:
matrix:
arch: ["native", "amd64", "arm64v8"]
steps:
- name: "Checkout project"
uses: "actions/checkout@v4"
- name: "Download artifacts"
uses: "actions/download-artifact@v4"
with:
name: "dist-common-stages"
path: "./dist/"
- name: "Load common stages"
run: |
docker system prune --all --force
make IMAGE_REGISTRY="localhost" IMAGE_NAMESPACE="stage" IMAGE_PROJECT="build" load-native-image clean
- name: "Register binfmt entries"
if: "matrix.arch != 'native'"
run: |
make binfmt-register
- name: 'Build and save image'
- name: "Build and save image"
run: |
make IMAGE_BUILD_OPTS="--pull" "build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image"
- name: 'Upload artifacts'
if: "startsWith(github.ref, 'refs/tags/v')"
uses: 'actions/upload-artifact@v3'
make \
IMAGE_BUILD_OPTS="--cache-from localhost/stage/build:latest" \
"build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image"
- name: "Upload artifacts"
if: "startsWith(github.ref, 'refs/tags/v') && matrix.arch != 'native'"
uses: "actions/upload-artifact@v4"
with:
name: 'dist-${{ matrix.arch }}'
path: './dist/'
name: "dist-${{ matrix.arch }}"
path: "./dist/"
retention-days: 1

push:
name: 'Push ${{ matrix.arch }} image'
name: "Push ${{ matrix.arch }} image"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['build']
runs-on: 'ubuntu-latest'
needs: ["build"]
runs-on: "ubuntu-latest"
permissions:
contents: 'read'
contents: "read"
strategy:
matrix:
arch: ['amd64', 'arm64v8', 'arm32v7']
arch: ["amd64", "arm64v8"]
steps:
- name: 'Checkout project'
uses: 'actions/checkout@v3'
- name: 'Download artifacts'
uses: 'actions/download-artifact@v3'
- name: "Checkout project"
uses: "actions/checkout@v4"
- name: "Download artifacts"
uses: "actions/download-artifact@v4"
with:
name: 'dist-${{ matrix.arch }}'
path: './dist/'
- name: 'Login to Docker Hub'
uses: 'docker/login-action@v1'
name: "dist-${{ matrix.arch }}"
path: "./dist/"
- name: "Login to Docker Hub"
uses: "docker/login-action@v3"
with:
registry: 'docker.io'
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: 'Load and push image'
registry: "docker.io"
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: "Load and push image"
run: |
make "load-${{ matrix.arch }}-image" "push-${{ matrix.arch }}-image"

push-manifest:
name: 'Push manifest'
name: "Push manifest"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['push']
runs-on: 'ubuntu-latest'
needs: ["push"]
runs-on: "ubuntu-latest"
permissions:
contents: 'read'
contents: "read"
steps:
- name: 'Checkout project'
uses: 'actions/checkout@v3'
- name: 'Login to Docker Hub'
uses: 'docker/login-action@v1'
- name: "Checkout project"
uses: "actions/checkout@v4"
- name: "Login to Docker Hub"
uses: "docker/login-action@v3"
with:
registry: 'docker.io'
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: 'Push manifest'
registry: "docker.io"
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: "Push manifest"
run: |
make push-cross-manifest

release-github:
name: 'Create GitHub release'
publish-github-release:
name: "Publish GitHub release"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ['push-manifest']
runs-on: 'ubuntu-latest'
needs: ["push-manifest"]
runs-on: "ubuntu-latest"
permissions:
contents: 'write'
contents: "write"
steps:
- name: 'Create release'
run: |
RELEASE_STATUS="$(curl -fs --proto '=https' --tlsv1.3 --globoff \
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/tags/${GITHUB_REF_NAME:?}" \
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
--write-out '%{http_code}' --output /dev/null ||:)"
if [ "${RELEASE_STATUS:?}" = '200' ]; then exit 0; fi
RELEASE_ID="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases" \
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
--data "$(jq -rn --arg tag "${GITHUB_REF_NAME:?}" '{"name": $tag, "tag_name": $tag, "generate_release_notes": true}')" | jq -r '.id')"
if [ -z "${RELEASE_ID-}" ] || [ "${RELEASE_ID:?}" = 'null' ]; then exit 1; fi
- name: "Publish"
uses: "hectorm/ghaction-release@066200d04c3549852afa243d631ea3dc93390f68"

View File

@ -1,33 +1,22 @@
name: 'Rebuild latest release'
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Rebuild latest release"

on:
schedule:
- cron: '20 04 * * 1'
- cron: "20 04 * * 1"
workflow_dispatch:

jobs:
permissions: {}

jobs:
trigger-rebuild:
name: 'Trigger rebuild'
runs-on: 'ubuntu-latest'
name: "Trigger rebuild"
runs-on: "ubuntu-latest"
permissions:
contents: 'read'
actions: "write"
contents: "read"
steps:
- name: 'REST API call'
run: |
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/latest' \
--header 'Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
| jq -rc '.tag_name')"
if [ -n "${RELEASE_TAG-}" ] && [ "${RELEASE_TAG:?}" != 'null' ]; then
curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url 'https://api.github.com/repos/${{ github.repository }}/actions/workflows/main.yml/dispatches' \
--header 'Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
--data "$(jq -rn --arg tag "${RELEASE_TAG:?}" '{"ref": $tag}')"
else
exit 1
fi
- name: "Trigger rebuild"
uses: "hectorm/ghaction-trigger-workflow@04c79e7a4e0c0b94bbcff3829f38359e34f1ea9e"
with:
workflow-id: "main.yml"

View File

@ -4,7 +4,7 @@ m4_changequote([[, ]])
## "build" stage
##################################################

FROM docker.io/ubuntu:20.04 AS build
FROM --platform=${BUILDPLATFORM} docker.io/ubuntu:24.04 AS build

# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
@ -22,17 +22,17 @@ RUN export DEBIAN_FRONTEND=noninteractive \
&& rm -rf /var/lib/apt/lists/*

# Download noVNC
ARG NOVNC_VERSION=v1.3.0
ARG NOVNC_VERSION=v1.5.0
ARG NOVNC_TARBALL_URL=https://github.com/novnc/noVNC/archive/${NOVNC_VERSION}.tar.gz
ARG NOVNC_TARBALL_CHECKSUM=ee8f91514c9ce9f4054d132f5f97167ee87d9faa6630379267e569d789290336
ARG NOVNC_TARBALL_CHECKSUM=6a73e41f98388a5348b7902f54b02d177cb73b7e5eb0a7a0dcf688cc2c79b42a
RUN curl -Lo /tmp/novnc.tgz "${NOVNC_TARBALL_URL:?}"
RUN printf '%s' "${NOVNC_TARBALL_CHECKSUM:?} /tmp/novnc.tgz" | sha256sum -c
RUN mkdir /tmp/novnc/ && tar -xzf /tmp/novnc.tgz --strip-components=1 -C /tmp/novnc/

# Download Websockify
ARG WEBSOCKIFY_VERSION=v0.10.0
ARG WEBSOCKIFY_VERSION=v0.12.0
ARG WEBSOCKIFY_TARBALL_URL=https://github.com/novnc/websockify/archive/${WEBSOCKIFY_VERSION}.tar.gz
ARG WEBSOCKIFY_TARBALL_CHECKSUM=7bd99b727e0be230f6f47f65fbe4bd2ae8b2aa3568350148bdf5cf440c4c6b4a
ARG WEBSOCKIFY_TARBALL_CHECKSUM=37448ec992ef626f29558404cf6535592d02894ec1d5f0990a8c62621b39a967
RUN curl -Lo /tmp/websockify.tgz "${WEBSOCKIFY_TARBALL_URL:?}"
RUN printf '%s' "${WEBSOCKIFY_TARBALL_CHECKSUM:?} /tmp/websockify.tgz" | sha256sum -c
RUN mkdir /tmp/websockify/ && tar -xzf /tmp/websockify.tgz --strip-components=1 -C /tmp/websockify/
@ -59,14 +59,14 @@ RUN curl -Lo /tmp/samba.exe "${SAMBA_EXE_URL:?}"
RUN printf '%s' "${SAMBA_EXE_CHECKSUM:?} /tmp/samba.exe" | sha256sum -c

# Download BusyBox
ARG BUSYBOX_EXE_URL=https://frippery.org/files/busybox/busybox-w32-FRP-4487-gd239d2d52.exe
ARG BUSYBOX_EXE_CHECKSUM=35e2b0db6d57a045188b9afc617aae52a6c8e2aa0205256c049f3537a48f879b
ARG BUSYBOX_EXE_URL=https://frippery.org/files/busybox/busybox-w32-FRP-5398-g89ae34445.exe
ARG BUSYBOX_EXE_CHECKSUM=e311f576b6222a6a30fc892c4be13bd42387bcca65563e7ffff7004b9460b86c
RUN curl -Lo /tmp/busybox.exe "${BUSYBOX_EXE_URL:?}"
RUN printf '%s' "${BUSYBOX_EXE_CHECKSUM:?} /tmp/busybox.exe" | sha256sum -c

# Download and install ReactOS
ARG REACTOS_ISO_URL=https://downloads.sourceforge.net/reactos/ReactOS-0.4.14-release-19-ga575acb-iso.zip
ARG REACTOS_ISO_CHECKSUM=afe34548b582a282448fb5cf885c899bf33e27fb72da7203163a0ce3d9d04a55
ARG REACTOS_ISO_URL=https://downloads.sourceforge.net/reactos/ReactOS-0.4.14-release-119-gce0b4ff-iso.zip
ARG REACTOS_ISO_CHECKSUM=2937a619c9988d9c697930160e378d21048069c74e224b5c5ff6be470784b7d8
RUN curl -Lo /tmp/reactos.zip "${REACTOS_ISO_URL:?}"
RUN printf '%s' "${REACTOS_ISO_CHECKSUM:?} /tmp/reactos.zip" | sha256sum -c
RUN 7z e /tmp/reactos.zip -so '*.iso' > /tmp/reactos.iso \
@ -82,7 +82,7 @@ RUN mkisofs -no-emul-boot -iso-level 4 -eltorito-boot loader/isoboot.bin -o /tmp
&& timeout 900 qemu-system-x86_64 \
-machine pc -smp 2 -m 512M -accel tcg \
-device VGA -display none -serial stdio \
-device e1000,netdev=n0 -netdev user,id=n0,restrict=on \
-device e1000,netdev=n0 -netdev user,id=n0,ipv4=on,ipv6=off,net=10.0.2.0/24,host=10.0.2.2,dns=10.0.2.3,dhcpstart=10.0.2.15,restrict=on \
-device ide-hd,id=disk0,bus=ide.0,drive=disk0 -blockdev driver=qcow2,node-name=disk0,file.driver=file,file.filename=/tmp/reactos.qcow2 \
-device ide-cd,id=cd0,bus=ide.1,drive=cd0 -blockdev driver=raw,node-name=cd0,file.driver=file,file.filename=/tmp/reactos.iso,read-only=on \
-boot order=cd,menu=off \
@ -92,32 +92,28 @@ RUN mkisofs -no-emul-boot -iso-level 4 -eltorito-boot loader/isoboot.bin -o /tmp
## "base" stage
##################################################

m4_ifdef([[CROSS_ARCH]], [[FROM docker.io/CROSS_ARCH/ubuntu:20.04]], [[FROM docker.io/ubuntu:20.04]]) AS base
m4_ifdef([[CROSS_QEMU]], [[COPY --from=docker.io/hectorm/qemu-user-static:latest CROSS_QEMU CROSS_QEMU]])
m4_ifdef([[CROSS_ARCH]], [[FROM docker.io/CROSS_ARCH/ubuntu:24.04]], [[FROM docker.io/ubuntu:24.04]]) AS base

# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
catatonit \
net-tools \
netcat-openbsd \
procps \
python3 \
qemu-kvm \
qemu-system-x86 \
qemu-utils \
rlwrap \
runit \
samba \
tini \
&& rm -rf /var/lib/apt/lists/*

# Environment
ENV VM_CPU=2
ENV VM_RAM=1024M
ENV VM_KEYBOARD=en-us
ENV VM_NET_GUESTFWD_OPTIONS=guestfwd=tcp:10.0.2.254:445-cmd:"nc 127.0.0.1 445"
ENV VM_NET_HOSTFWD_OPTIONS=hostfwd=tcp::2323-:23,hostfwd=tcp::5151-:51,hostfwd=tcp::3389-:3389
ENV VM_NET_EXTRA_OPTIONS=
ENV VM_KVM=true
ENV SVDIR=/etc/service/
@ -146,7 +142,7 @@ COPY --chown=root:root ./scripts/bin/ /usr/local/bin/
RUN find /usr/local/bin/ -type d -not -perm 0755 -exec chmod 0755 '{}' ';'
RUN find /usr/local/bin/ -type f -not -perm 0755 -exec chmod 0755 '{}' ';'

ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/container-init"]
ENTRYPOINT ["/usr/bin/catatonit", "--", "/usr/local/bin/container-init"]

##################################################
## "test" stage
@ -157,8 +153,8 @@ FROM base AS test
RUN if [ "$(uname -m)" = 'x86_64' ]; then \
container-init & \
printf '%s\n' 'The quick brown fox jumps over the lazy dog' > /mnt/in || exit 1; \
printf '%s\n' '@echo off & smbclient -c "get /in C:/local; quit" //10.0.2.254/share noop & exit' | timeout 900 vmshell || exit 1; \
printf '%s\n' '@echo off & smbclient -c "put C:/local /out; quit" //10.0.2.254/share noop & exit' | timeout 120 vmshell || exit 1; \
printf '%s\n' '@echo off & smbclient -c "get /in C:/local; quit" //10.0.2.2/share noop & exit' | timeout 900 vmshell || exit 1; \
printf '%s\n' '@echo off & smbclient -c "put C:/local /out; quit" //10.0.2.2/share noop & exit' | timeout 120 vmshell || exit 1; \
cmp -s /mnt/in /mnt/out || exit 1; \
fi


View File

@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © 2022 Héctor Molinero Fernández
Copyright © Héctor Molinero Fernández

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -14,9 +14,14 @@ IMAGE_REGISTRY := docker.io
IMAGE_NAMESPACE := hectorm
IMAGE_PROJECT := qemu-reactos
IMAGE_NAME := $(IMAGE_REGISTRY)/$(IMAGE_NAMESPACE)/$(IMAGE_PROJECT)
IMAGE_GIT_TAG := $(shell '$(GIT)' tag -l --contains HEAD 2>/dev/null)
IMAGE_GIT_SHA := $(shell '$(GIT)' rev-parse HEAD 2>/dev/null)
IMAGE_VERSION := $(if $(IMAGE_GIT_TAG),$(IMAGE_GIT_TAG),$(if $(IMAGE_GIT_SHA),$(IMAGE_GIT_SHA),nil))
ifeq ($(shell '$(GIT)' status --porcelain 2>/dev/null),)
IMAGE_GIT_TAG := $(shell '$(GIT)' tag --list --contains HEAD 2>/dev/null)
IMAGE_GIT_SHA := $(shell '$(GIT)' rev-parse --verify --short HEAD 2>/dev/null)
IMAGE_VERSION := $(if $(IMAGE_GIT_TAG),$(IMAGE_GIT_TAG),$(if $(IMAGE_GIT_SHA),$(IMAGE_GIT_SHA),nil))
else
IMAGE_GIT_BRANCH := $(shell '$(GIT)' symbolic-ref --short HEAD 2>/dev/null)
IMAGE_VERSION := $(if $(IMAGE_GIT_BRANCH),$(IMAGE_GIT_BRANCH)-dirty,nil)
endif

IMAGE_BUILD_OPTS :=

@ -26,8 +31,6 @@ IMAGE_AMD64_DOCKERFILE := $(DISTDIR)/Dockerfile.amd64
IMAGE_AMD64_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).amd64.tzst
IMAGE_ARM64V8_DOCKERFILE := $(DISTDIR)/Dockerfile.arm64v8
IMAGE_ARM64V8_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm64v8.tzst
IMAGE_ARM32V7_DOCKERFILE := $(DISTDIR)/Dockerfile.arm32v7
IMAGE_ARM32V7_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm32v7.tzst

export DOCKER_BUILDKIT := 1
export BUILDKIT_PROGRESS := plain
@ -50,14 +53,14 @@ $(IMAGE_NATIVE_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKERFILE_TEMPLATE)' > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)' \
--tag '$(IMAGE_NAME):latest' \
--file '$@' ./

.PHONY: build-cross-images
build-cross-images: build-amd64-image build-arm64v8-image build-arm32v7-image
build-cross-images: build-amd64-image build-arm64v8-image

.PHONY: build-amd64-image
build-amd64-image: $(IMAGE_AMD64_DOCKERFILE)
@ -67,11 +70,11 @@ $(IMAGE_AMD64_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
'$(M4)' \
--prefix-builtins \
--define=CROSS_ARCH=amd64 \
--define=CROSS_QEMU=/usr/bin/qemu-x86_64-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKERFILE_TEMPLATE)' > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-amd64' \
--tag '$(IMAGE_NAME):latest-amd64' \
--platform linux/amd64 \
--file '$@' ./

.PHONY: build-arm64v8-image
@ -82,26 +85,11 @@ $(IMAGE_ARM64V8_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
'$(M4)' \
--prefix-builtins \
--define=CROSS_ARCH=arm64v8 \
--define=CROSS_QEMU=/usr/bin/qemu-aarch64-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKERFILE_TEMPLATE)' > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8' \
--tag '$(IMAGE_NAME):latest-arm64v8' \
--file '$@' ./

.PHONY: build-arm32v7-image
build-arm32v7-image: $(IMAGE_ARM32V7_DOCKERFILE)

$(IMAGE_ARM32V7_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
--define=CROSS_ARCH=arm32v7 \
--define=CROSS_QEMU=/usr/bin/qemu-arm-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7' \
--tag '$(IMAGE_NAME):latest-arm32v7' \
--platform linux/arm64/v8 \
--file '$@' ./

##################################################
@ -119,7 +107,7 @@ $(IMAGE_NATIVE_TARBALL): $(IMAGE_NATIVE_DOCKERFILE)
$(call save_image,$(IMAGE_NAME):$(IMAGE_VERSION),$@)

.PHONY: save-cross-images
save-cross-images: save-amd64-image save-arm64v8-image save-arm32v7-image
save-cross-images: save-amd64-image save-arm64v8-image

.PHONY: save-amd64-image
save-amd64-image: $(IMAGE_AMD64_TARBALL)
@ -133,12 +121,6 @@ save-arm64v8-image: $(IMAGE_ARM64V8_TARBALL)
$(IMAGE_ARM64V8_TARBALL): $(IMAGE_ARM64V8_DOCKERFILE)
$(call save_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8,$@)

.PHONY: save-arm32v7-image
save-arm32v7-image: $(IMAGE_ARM32V7_TARBALL)

$(IMAGE_ARM32V7_TARBALL): $(IMAGE_ARM32V7_DOCKERFILE)
$(call save_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7,$@)

##################################################
## "load-*" targets
##################################################
@ -157,7 +139,7 @@ load-native-image:
$(call tag_image,$(IMAGE_NAME):$(IMAGE_VERSION),$(IMAGE_NAME):latest)

.PHONY: load-cross-images
load-cross-images: load-amd64-image load-arm64v8-image load-arm32v7-image
load-cross-images: load-amd64-image load-arm64v8-image

.PHONY: load-amd64-image
load-amd64-image:
@ -169,11 +151,6 @@ load-arm64v8-image:
$(call load_image,$(IMAGE_ARM64V8_TARBALL))
$(call tag_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8,$(IMAGE_NAME):latest-arm64v8)

.PHONY: load-arm32v7-image
load-arm32v7-image:
$(call load_image,$(IMAGE_ARM32V7_TARBALL))
$(call tag_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7,$(IMAGE_NAME):latest-arm32v7)

##################################################
## "push-*" targets
##################################################
@ -183,10 +160,9 @@ define push_image
endef

define push_cross_manifest
'$(DOCKER)' manifest create --amend '$(1)' '$(2)-amd64' '$(2)-arm64v8' '$(2)-arm32v7'
'$(DOCKER)' manifest create --amend '$(1)' '$(2)-amd64' '$(2)-arm64v8'
'$(DOCKER)' manifest annotate '$(1)' '$(2)-amd64' --os linux --arch amd64
'$(DOCKER)' manifest annotate '$(1)' '$(2)-arm64v8' --os linux --arch arm64 --variant v8
'$(DOCKER)' manifest annotate '$(1)' '$(2)-arm32v7' --os linux --arch arm --variant v7
'$(DOCKER)' manifest push --purge '$(1)'
endef

@ -195,7 +171,7 @@ push-native-image:
@printf '%s\n' 'Unimplemented'

.PHONY: push-cross-images
push-cross-images: push-amd64-image push-arm64v8-image push-arm32v7-image
push-cross-images: push-amd64-image push-arm64v8-image

.PHONY: push-amd64-image
push-amd64-image:
@ -207,11 +183,6 @@ push-arm64v8-image:
$(call push_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8)
$(call push_image,$(IMAGE_NAME):latest-arm64v8)

.PHONY: push-arm32v7-image
push-arm32v7-image:
$(call push_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7)
$(call push_image,$(IMAGE_NAME):latest-arm32v7)

push-cross-manifest:
$(call push_cross_manifest,$(IMAGE_NAME):$(IMAGE_VERSION),$(IMAGE_NAME):$(IMAGE_VERSION))
$(call push_cross_manifest,$(IMAGE_NAME):latest,$(IMAGE_NAME):latest)
@ -222,7 +193,7 @@ push-cross-manifest:

.PHONY: binfmt-register
binfmt-register:
'$(DOCKER)' run --rm --privileged docker.io/hectorm/qemu-user-static:latest --reset
'$(DOCKER)' run --rm --privileged docker.io/hectorm/qemu-user-static:latest --reset --persistent yes --credential yes

##################################################
## "version" target
@ -246,6 +217,6 @@ version:

.PHONY: clean
clean:
rm -f '$(IMAGE_NATIVE_DOCKERFILE)' '$(IMAGE_AMD64_DOCKERFILE)' '$(IMAGE_ARM64V8_DOCKERFILE)' '$(IMAGE_ARM32V7_DOCKERFILE)'
rm -f '$(IMAGE_NATIVE_TARBALL)' '$(IMAGE_AMD64_TARBALL)' '$(IMAGE_ARM64V8_TARBALL)' '$(IMAGE_ARM32V7_TARBALL)'
rm -f '$(IMAGE_NATIVE_DOCKERFILE)' '$(IMAGE_AMD64_DOCKERFILE)' '$(IMAGE_ARM64V8_DOCKERFILE)'
rm -f '$(IMAGE_NATIVE_TARBALL)' '$(IMAGE_AMD64_TARBALL)' '$(IMAGE_ARM64V8_TARBALL)'
if [ -d '$(DISTDIR)' ] && [ -z "$$(ls -A '$(DISTDIR)')" ]; then rmdir '$(DISTDIR)'; fi

View File

@ -9,13 +9,17 @@ docker run --detach \
--device /dev/kvm \
--publish 127.0.0.1:5900:5900/tcp \
--publish 127.0.0.1:6080:6080/tcp \
--mount type=volume,src=qemu-reactos-disk,dst=/var/lib/qemu/disk/ \
docker.io/hectorm/qemu-reactos:latest
```

> [!NOTE]
> The `--device /dev/kvm` option can only be used on Linux hosts, it can be removed on Windows and macOS hosts at a significant performance penalty.

The instance can be accessed from:
* **VNC (5900/TCP):** any VNC client, without credentials.
* **noVNC (6080/TCP):** http://127.0.0.1:6080/vnc.html
* **Shell:** `docker exec -it qemu-reactos vmshell`
* **VNC** (`5900/TCP`), without password.
* **noVNC** (`6080/TCP`), http://127.0.0.1:6080/vnc.html
* `docker exec -it qemu-reactos vmshell`

## Environment variables
#### `VM_CPU`

View File

@ -2,4 +2,4 @@

set -eu

printf '%s\n' 'system_powerdown' | nc -U /run/qemu-monitor
printf '%s\n' 'system_powerdown' | nc -w 1 -U /run/qemu-monitor

View File

@ -5,7 +5,7 @@ set -eu
set --
set -- "$@" -machine pc -smp "${VM_CPU:?}" -m "${VM_RAM:?}"
set -- "$@" -device VGA -display vnc=:0 -serial stdio -monitor unix:/run/qemu-monitor,server,nowait
set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,"${VM_NET_GUESTFWD_OPTIONS?}","${VM_NET_HOSTFWD_OPTIONS?}","${VM_NET_EXTRA_OPTIONS?}"
set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,ipv4=on,ipv6=off,net=10.0.2.0/24,host=10.0.2.2,dns=10.0.2.3,dhcpstart=10.0.2.15,hostfwd=tcp::2323-:23,hostfwd=tcp::5151-:51,hostfwd=tcp::3389-:3389,"${VM_NET_EXTRA_OPTIONS?}"
set -- "$@" -device ide-hd,id=disk0,bus=ide.0,drive=disk0 -blockdev driver=qcow2,node-name=disk0,file.driver=file,file.filename=/var/lib/qemu/disk/reactos.qcow2
set -- "$@" -usb -device usb-tablet
set -- "$@" -k "${VM_KEYBOARD:?}"

View File

@ -2,6 +2,10 @@

set -eu

if [ ! -d /run/samba/ ]; then
install -m 755 -o root -g root -d /run/samba/
fi

cd /run/samba/
exec 2>&1
exec /usr/sbin/smbd --foreground --log-stdout --debuglevel=3
exec /usr/sbin/smbd --foreground --debug-stdout --debuglevel=3