Compare commits

...

168 Commits
v14 ... 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
Héctor Molinero Fernández
099a608499 v43 2022-04-26 23:18:42 +02:00
Héctor Molinero Fernández
6dc6cc3d6c Fixed quotes 2022-04-26 23:18:40 +02:00
Héctor Molinero Fernández
75f1a2e6f0 Revert "Updated base image to Ubuntu 22.04"
This reverts commit a4a42cd203.
2022-04-26 23:17:48 +02:00
Héctor Molinero Fernández
e9b0ec8326 v42 2022-04-26 22:21:03 +02:00
Héctor Molinero Fernández
a4a42cd203 Updated base image to Ubuntu 22.04 2022-04-26 22:18:34 +02:00
Héctor Molinero Fernández
5aaac72250 Migration to GitHub Actions and image namespace update 2022-04-26 22:11:31 +02:00
Héctor Molinero Fernández
3abd969ba5 v41 2022-04-02 13:56:16 +02:00
Héctor Molinero Fernández
24109f30c5 Updated ReactOS to v0.4.14-19 2022-04-02 13:56:13 +02:00
Héctor Molinero Fernández
69f35f3305 Updated "actions/checkout" to v3 2022-03-02 19:46:49 +01:00
Héctor Molinero Fernández
b7363ac498 Added workflow to rebuild the latest release 2022-02-10 20:00:10 +01:00
Héctor Molinero Fernández
4ceea99e10 v40 2022-02-09 00:14:51 +01:00
Héctor Molinero Fernández
013512b665 Added GitHub workflow for CI 2022-02-08 23:39:47 +01:00
Héctor Molinero Fernández
900242aa90 Removed version file 2022-02-08 23:23:15 +01:00
Héctor Molinero Fernández
d1e8f99a06 Simplified .gitlab-ci.yml 2022-02-08 23:15:29 +01:00
Héctor Molinero Fernández
c3184e7aee Updated license year 2022-02-08 23:11:20 +01:00
Héctor Molinero Fernández
e3a5ebf1e7 v39 2021-12-18 16:33:14 +01:00
Héctor Molinero Fernández
b81adc41bd Updated ReactOS to v0.4.14 2021-12-18 16:22:51 +01:00
Héctor Molinero Fernández
23e26cf252 v38 2021-11-21 12:44:52 +01:00
Héctor Molinero Fernández
78d19ebe17 Updated ReactOS to v0.4.14-RC-123 2021-11-21 12:36:34 +01:00
Héctor Molinero Fernández
fc8f7730ea Set block device ids 2021-11-21 12:20:36 +01:00
Héctor Molinero Fernández
fd018a9832 v37 2021-11-20 17:22:10 +01:00
Héctor Molinero Fernández
dca69730d0 Added srvany-ng 2021-11-20 17:17:22 +01:00
Héctor Molinero Fernández
d04ea44a0c Updated ReactOS to v0.4.14-RC-122 2021-11-20 16:42:16 +01:00
Héctor Molinero Fernández
30cccc21ff Added floppy disk support and updated deprecated options 2021-11-20 14:15:49 +01:00
Héctor Molinero Fernández
90a037e348 v36 2021-11-17 20:50:20 +01:00
Héctor Molinero Fernández
16e47502d0 Updated ReactOS to v0.4.14-RC-120 2021-11-17 19:56:47 +01:00
Héctor Molinero Fernández
b4d1c623c1 v35 2021-11-15 22:54:11 +01:00
Héctor Molinero Fernández
49ed398608 Emulate the host processor 2021-11-15 19:51:53 +01:00
Héctor Molinero Fernández
cc0409831a v34 2021-11-14 15:04:25 +01:00
Héctor Molinero Fernández
fd9402c45a Defined machine type explicitly 2021-11-14 14:19:15 +01:00
Héctor Molinero Fernández
b1c15bd06a Added support for mounting ISOs 2021-11-14 14:08:28 +01:00
Héctor Molinero Fernández
01b5d31067 v33 2021-11-12 00:03:54 +01:00
Héctor Molinero Fernández
10fe1a6111 Added VSCode config 2021-11-11 23:59:39 +01:00
Héctor Molinero Fernández
92a0f8589a Improved integration test 2021-11-11 23:39:22 +01:00
Héctor Molinero Fernández
ac92f70438 Sleep one more second 2021-11-11 23:22:16 +01:00
Héctor Molinero Fernández
e91306b997 Updated ReactOS to v0.4.14-RC-118 2021-11-11 23:16:09 +01:00
Héctor Molinero Fernández
9a75519e1d Split network options 2021-11-11 23:15:37 +01:00
Héctor Molinero Fernández
1e9eb26b35 Restrict network during installation 2021-11-11 23:05:58 +01:00
Héctor Molinero Fernández
4400e4019f Updated readme 2021-11-11 22:54:22 +01:00
Héctor Molinero Fernández
606de052cc v32 2021-11-07 22:02:40 +01:00
Héctor Molinero Fernández
92dd9a8e7e Added Samba, BusyBox and a bind shell service 2021-11-07 22:02:39 +01:00
Héctor Molinero Fernández
29e5bec8ba v31 2021-11-02 22:19:18 +01:00
Héctor Molinero Fernández
d6f9f65623 Move first run commands to a separate batch file 2021-11-02 22:07:24 +01:00
Héctor Molinero Fernández
2adbc66a7c Unattended install of ReactOS 2021-11-02 21:20:19 +01:00
Héctor Molinero Fernández
88a1b868a8 Shutdown services gracefully 2021-11-02 19:23:18 +01:00
Héctor Molinero Fernández
55587ba1f8 Set SVDIR 2021-11-02 19:18:31 +01:00
Héctor Molinero Fernández
222d899993 Document 5900/TCP port 2021-11-02 19:17:57 +01:00
Héctor Molinero Fernández
a030d46efc Enabled KVM by default 2021-11-02 19:16:38 +01:00
Héctor Molinero Fernández
c6b529b31d v30 2021-10-31 18:15:13 +01:00
Héctor Molinero Fernández
d065da672e Explicitly set permissions for all copied files 2021-10-31 18:13:25 +01:00
Héctor Molinero Fernández
14e5c6dc2d Removed unnecessary "--" from printf 2021-10-31 18:11:57 +01:00
Héctor Molinero Fernández
2ccc1af63a v29 2021-10-31 13:08:25 +01:00
Héctor Molinero Fernández
49e2d5e9ef Applied the same changes made to my other Haiku OS image 2021-10-31 13:07:59 +01:00
Héctor Molinero Fernández
1fd9c253a0 Updated ReactOS to v0.4.14-RC-117 2021-10-31 12:09:09 +01:00
Héctor Molinero Fernández
420f16c785 Use native arch in build stage 2021-10-31 12:08:27 +01:00
Héctor Molinero Fernández
4695fb28bc Enabled BuildKit 2021-10-31 12:03:48 +01:00
Héctor Molinero Fernández
b99b5590fc Replaced "docker.io/docker:stable" with "docker.io/docker:latest" 2021-10-31 12:03:27 +01:00
Héctor Molinero Fernández
f67b19be3f Updated noVNC to v1.3.0 2021-10-30 22:01:13 +02:00
Héctor Molinero Fernández
ebb73bd89d v28 2021-08-02 21:37:24 +02:00
Héctor Molinero Fernández
d9b34fadd2 Check if /dev/kvm exists and prefer to mount that device rather than start a privileged container 2021-08-02 21:32:53 +02:00
Héctor Molinero Fernández
c4905ecf00 Renamed variables "QEMU_" to "QEMU_VM_" to avoid conflict with environment variables supported by QEMU 2021-08-02 21:32:49 +02:00
Héctor Molinero Fernández
b261afcbd2 Build multiarch image 2021-08-02 21:06:18 +02:00
Héctor Molinero Fernández
8b24554e17 v27 2021-07-25 19:09:05 +02:00
Héctor Molinero Fernández
7b0a29132e Updated Websockify to v0.10.0 2021-07-25 18:52:48 +02:00
Héctor Molinero Fernández
fff158a37e v26 2021-07-18 12:49:22 +02:00
Héctor Molinero Fernández
fc53e0bddf Updated ReactOS to v0.4.14-RC-96 2021-07-18 12:48:57 +02:00
Héctor Molinero Fernández
400683c210 v25 2021-06-22 21:08:46 +02:00
Héctor Molinero Fernández
2d255d5ec4 Updated ReactOS to v0.4.14-RC-78 2021-06-22 20:45:32 +02:00
Héctor Molinero Fernández
f68b345d07 v24 2021-05-25 22:41:53 +02:00
Héctor Molinero Fernández
89493c8540 Updated ReactOS to v0.4.14-RC-67 2021-05-25 21:41:46 +02:00
Héctor Molinero Fernández
e2e4cfa564 v23 2021-02-11 21:30:23 +01:00
Héctor Molinero Fernández
d514fd323f Updated ReactOS to v0.4.14-RC-64 2021-02-11 21:23:01 +01:00
Héctor Molinero Fernández
984e79474d Define registry explicitly 2021-02-11 21:20:03 +01:00
Héctor Molinero Fernández
3d09e519dd v22 2021-01-17 12:39:25 +01:00
Héctor Molinero Fernández
4d3cb166cd Updated license year 2021-01-15 19:35:18 +01:00
Héctor Molinero Fernández
8f0793db9e Use Zstandard to transfer Docker images between CI jobs 2021-01-15 19:35:12 +01:00
Héctor Molinero Fernández
7687a6b533 v21 2020-07-14 21:20:48 +02:00
Héctor Molinero Fernández
1a5a9fd5b3 Updated noVNC to v1.2.0 2020-07-14 20:32:22 +02:00
Héctor Molinero Fernández
97671e1dab v20 2020-07-07 19:00:59 +02:00
Héctor Molinero Fernández
a8d41d1034 Updated noVNC to v1.2.0-beta 2020-07-07 19:00:40 +02:00
Héctor Molinero Fernández
8e76e78689 v19 2020-06-10 23:11:02 +02:00
Héctor Molinero Fernández
e680530071 Use a multi-stage build 2020-06-10 22:48:26 +02:00
Héctor Molinero Fernández
fdddb96dcf Websockify does not benefit from NumPy in the context of noVNC, novnc/websockify#77 2020-06-10 22:36:14 +02:00
Héctor Molinero Fernández
3db499da11 Switch to Ubuntu 20.04 2020-06-10 22:35:55 +02:00
Héctor Molinero Fernández
428265e435 v18 2020-05-22 19:35:33 +02:00
Héctor Molinero Fernández
7fa7bbe095 Always pull images in CI 2020-05-22 18:52:24 +02:00
Héctor Molinero Fernández
27e8c8da4d Removed FUNDING.yml file 2020-05-22 17:01:04 +02:00
Héctor Molinero Fernández
245b10bae0 ./ 2020-05-22 17:00:57 +02:00
Héctor Molinero Fernández
9cca08e419 v17 2020-04-09 13:12:46 +02:00
Héctor Molinero Fernández
b5b84bbc40 Updated ReactOS to v0.4.13 2020-04-09 12:56:34 +02:00
Héctor Molinero Fernández
7457cfa4c1 Updated license year 2020-04-09 12:56:17 +02:00
Héctor Molinero Fernández
8786d2f5cb v16 2019-12-12 13:05:19 +01:00
Héctor Molinero Fernández
9c32e94ca5 Updated GitLab CI 2019-12-12 13:04:47 +01:00
Héctor Molinero Fernández
7820a0bd4e v15 2019-11-03 20:27:22 +01:00
Héctor Molinero Fernández
8eb94c4909 Switch to debian:10 2019-11-03 20:22:45 +01:00
24 changed files with 696 additions and 210 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
*.bat eol=crlf
*.inf eol=crlf

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
custom: https://hector.molinero.dev/donate

19
.github/dependabot.yml vendored Normal file
View File

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

updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
groups:
docker-all:
patterns: ["*"]

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

134
.github/workflows/main.yml vendored Normal file
View File

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

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

permissions: {}

jobs:
build-common-stages:
name: "Build common stages"
runs-on: "ubuntu-latest"
permissions:
contents: "read"
strategy:
matrix:
stage: ["build"]
steps:
- 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"
run: |
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/"
retention-days: 1

push:
name: "Push ${{ matrix.arch }} image"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ["build"]
runs-on: "ubuntu-latest"
permissions:
contents: "read"
strategy:
matrix:
arch: ["amd64", "arm64v8"]
steps:
- 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@v3"
with:
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"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ["push"]
runs-on: "ubuntu-latest"
permissions:
contents: "read"
steps:
- 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"
run: |
make push-cross-manifest

publish-github-release:
name: "Publish GitHub release"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ["push-manifest"]
runs-on: "ubuntu-latest"
permissions:
contents: "write"
steps:
- name: "Publish"
uses: "hectorm/ghaction-release@066200d04c3549852afa243d631ea3dc93390f68"

View File

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

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

permissions: {}

jobs:
trigger-rebuild:
name: "Trigger rebuild"
runs-on: "ubuntu-latest"
permissions:
actions: "write"
contents: "read"
steps:
- name: "Trigger rebuild"
uses: "hectorm/ghaction-trigger-workflow@04c79e7a4e0c0b94bbcff3829f38359e34f1ea9e"
with:
workflow-id: "main.yml"

View File

@ -1,38 +0,0 @@
stages:
- "build:images"
- "push:images"

variables:
DOCKER_HOST: "tcp://dockerd:2376"
DOCKER_TLS_SAN: "DNS:dockerd"
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_DRIVER: "overlay2"

default:
image: "docker.io/docker:stable"
services:
- name: "docker.io/docker:dind"
alias: "dockerd"

build:images:
stage: "build:images"
before_script:
- "apk add --no-cache coreutils git make xz"
script:
- "make build-image save-image"
artifacts:
expire_in: "1 day"
paths:
- "./dist/"

push:images:
stage: "push:images"
dependencies:
- "build:images"
only:
- "/^v[0-9]+$/"
before_script:
- "apk add --no-cache coreutils git make xz"
- "docker login -u \"${CI_REGISTRY_USER:?}\" -p \"${CI_REGISTRY_PASSWORD:?}\" \"${CI_REGISTRY:?}\""
script:
- "make load-image push-image"

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"files.associations": {
"*.inf": "properties"
}
}

View File

@ -1,78 +0,0 @@
##################################################
## "qemu-reactos" stage
##################################################

FROM docker.io/debian:sid AS qemu-reactos

# Environment
ENV QEMU_CPU=2
ENV QEMU_RAM=1024M
ENV QEMU_DISK_SIZE=16G
ENV QEMU_DISK_FORMAT=qcow2
ENV QEMU_KEYBOARD=en-us
ENV QEMU_NET_DEVICE=e1000
ENV QEMU_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
ENV QEMU_BOOT_ORDER=cd
ENV QEMU_BOOT_MENU=off
ENV QEMU_KVM=false

# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
net-tools \
procps \
python3 \
python3-numpy \
qemu-kvm \
qemu-system-x86 \
qemu-utils \
runit \
unzip \
&& rm -rf /var/lib/apt/lists/*

# Install noVNC
ARG NOVNC_VERSION=v1.1.0
ARG NOVNC_TARBALL_URL=https://github.com/novnc/noVNC/archive/${NOVNC_VERSION}.tar.gz
ARG NOVNC_TARBALL_CHECKSUM=2c63418b624a221a28cac7b9a7efecc092b695fc1b7dd88255b074ab32bc72a7
RUN mkdir -p /opt/novnc/ \
&& curl -Lo /tmp/novnc.tgz "${NOVNC_TARBALL_URL:?}" \
&& printf '%s' "${NOVNC_TARBALL_CHECKSUM:?} /tmp/novnc.tgz" | sha256sum -c \
&& tar -xzf /tmp/novnc.tgz --strip-components=1 -C /opt/novnc/ \
&& rm -f /tmp/novnc.tgz

# Install Websockify
ARG WEBSOCKIFY_VERSION=v0.9.0
ARG WEBSOCKIFY_TARBALL_URL=https://github.com/novnc/websockify/archive/${WEBSOCKIFY_VERSION}.tar.gz
ARG WEBSOCKIFY_TARBALL_CHECKSUM=6ebfec791dd78be6584fb5fe3bc27f02af54501beddf8457368699f571de13ae
RUN mkdir -p /opt/novnc/utils/websockify/ \
&& curl -Lo /tmp/websockify.tgz "${WEBSOCKIFY_TARBALL_URL:?}" \
&& printf '%s' "${WEBSOCKIFY_TARBALL_CHECKSUM:?} /tmp/websockify.tgz" | sha256sum -c \
&& tar -xzf /tmp/websockify.tgz --strip-components=1 -C /opt/novnc/utils/websockify/ \
&& rm -f /tmp/websockify.tgz

# Download ReactOS ISO
ARG REACTOS_ISO_URL=https://downloads.sourceforge.net/project/reactos/ReactOS/0.4.12/ReactOS-0.4.12-iso.zip
ARG REACTOS_ISO_CHECKSUM=16351c1352a05576e920fe3453a4a9e79bfd551b1dba696fbd16c61b60ce4c86
RUN mkdir -p /tmp/reactos/ /var/lib/qemu/iso/ /var/lib/qemu/images/ \
&& curl -Lo /tmp/reactos/reactos.zip "${REACTOS_ISO_URL:?}" \
&& printf '%s' "${REACTOS_ISO_CHECKSUM:?} /tmp/reactos/reactos.zip" | sha256sum -c \
&& unzip /tmp/reactos/reactos.zip -d /tmp/reactos/ \
&& mv /tmp/reactos/*.iso /var/lib/qemu/iso/reactos.iso \
&& rm -rf /tmp/reactos/

# Copy services
COPY --chown=root:root scripts/service/ /etc/service/

# Copy scripts
COPY --chown=root:root scripts/bin/ /usr/local/bin/

# Expose ports
## VNC
EXPOSE 5900/tcp
## noVNC
EXPOSE 6080/tcp

CMD ["/usr/local/bin/container-foreground-cmd"]

168
Dockerfile.m4 Normal file
View File

@ -0,0 +1,168 @@
m4_changequote([[, ]])

##################################################
## "build" stage
##################################################

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

# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
binutils-mingw-w64-i686 \
ca-certificates \
curl \
gcc-mingw-w64-i686 \
genisoimage \
make \
p7zip-full \
qemu-system-x86 \
qemu-utils \
&& rm -rf /var/lib/apt/lists/*

# Download noVNC
ARG NOVNC_VERSION=v1.5.0
ARG NOVNC_TARBALL_URL=https://github.com/novnc/noVNC/archive/${NOVNC_VERSION}.tar.gz
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.12.0
ARG WEBSOCKIFY_TARBALL_URL=https://github.com/novnc/websockify/archive/${WEBSOCKIFY_VERSION}.tar.gz
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/

# Download and build srvany-ng
ARG SRVANY_NG_TARBALL_URL=https://github.com/hectorm/srvany-ng/archive/refs/tags/v1.0.tar.gz
ARG SRVANY_NG_TARBALL_CHECKSUM=62d4c85d5dbef86d57bf5d21ff913bce81b821735df293968e1706f85096c8b0
RUN curl -Lo /tmp/srvany-ng.tgz "${SRVANY_NG_TARBALL_URL:?}"
RUN printf '%s' "${SRVANY_NG_TARBALL_CHECKSUM:?} /tmp/srvany-ng.tgz" | sha256sum -c
RUN mkdir /tmp/srvany-ng/ && tar -xzf /tmp/srvany-ng.tgz --strip-components=1 -C /tmp/srvany-ng/
RUN make -C /tmp/srvany-ng/ build

# Download ncat
ARG NCAT_ZIP_URL=https://nmap.org/dist/ncat-portable-5.59BETA1.zip
ARG NCAT_ZIP_CHECKSUM=9cdc2e688410f4563af7002d8dfa3f8a5710f15f6d409be2cab4e87890c91d1c
RUN curl -Lo /tmp/ncat.zip "${NCAT_ZIP_URL:?}"
RUN printf '%s' "${NCAT_ZIP_CHECKSUM:?} /tmp/ncat.zip" | sha256sum -c
RUN 7z e /tmp/ncat.zip -so '**/*.exe' > /tmp/ncat.exe

# Download Samba
ARG SAMBA_EXE_URL=https://svn.reactos.org/packages/samba-for-ReactOSv1.3.exe
ARG SAMBA_EXE_CHECKSUM=c3f55cd7a4069cd682cbdca3954c425f6657e3a1aba786e3d1559448e9f849a3
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-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-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 \
&& 7z x /tmp/reactos.iso -o/tmp/reactos/ \
&& rm -f /tmp/reactos.iso
COPY --chown=root:root ./data/iso/ /tmp/reactos/
RUN install -D /tmp/srvany-ng/srvany-ng.exe /tmp/reactos/reactos/3rdParty/srvany-ng.exe
RUN install -D /tmp/ncat.exe /tmp/reactos/reactos/3rdParty/ncat.exe
RUN install -D /tmp/samba.exe /tmp/reactos/reactos/3rdParty/samba.exe
RUN install -D /tmp/busybox.exe /tmp/reactos/reactos/3rdParty/busybox.exe
RUN mkisofs -no-emul-boot -iso-level 4 -eltorito-boot loader/isoboot.bin -o /tmp/reactos.iso /tmp/reactos/ \
&& qemu-img create -f qcow2 /tmp/reactos.qcow2 128G \
&& 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,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 \
-usb -device usb-tablet

##################################################
## "base" stage
##################################################

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-system-x86 \
qemu-utils \
rlwrap \
runit \
samba \
&& rm -rf /var/lib/apt/lists/*

# Environment
ENV VM_CPU=2
ENV VM_RAM=1024M
ENV VM_KEYBOARD=en-us
ENV VM_NET_EXTRA_OPTIONS=
ENV VM_KVM=true
ENV SVDIR=/etc/service/

# Copy noVNC
COPY --from=build --chown=root:root /tmp/novnc/ /opt/novnc/

# Copy Websockify
COPY --from=build --chown=root:root /tmp/websockify/ /opt/novnc/utils/websockify/

# Copy ReactOS disk
COPY --from=build --chown=root:root /tmp/reactos.qcow2 /var/lib/qemu/disk/reactos.qcow2

# Copy Samba config
COPY --chown=root:root ./config/samba/ /etc/samba/
RUN find /etc/samba/ -type d -not -perm 0755 -exec chmod 0755 '{}' ';'
RUN find /etc/samba/ -type f -not -perm 0644 -exec chmod 0644 '{}' ';'

# Copy services
COPY --chown=root:root ./scripts/service/ /etc/service/
RUN find /etc/service/ -type d -not -perm 0755 -exec chmod 0755 '{}' ';'
RUN find /etc/service/ -type f -not -perm 0755 -exec chmod 0755 '{}' ';'

# Copy bin scripts
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/catatonit", "--", "/usr/local/bin/container-init"]

##################################################
## "test" stage
##################################################

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.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

##################################################
## "main" stage
##################################################

FROM base AS main

# Dummy instruction so BuildKit does not skip the test stage
RUN --mount=type=bind,from=test,source=/mnt/,target=/mnt/

View File

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

Copyright © 2019 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

177
Makefile
View File

@ -1,77 +1,156 @@
#!/usr/bin/make -f

SHELL := /bin/sh
.SHELLFLAGS := -eu -c
.SHELLFLAGS := -euc

DOCKER := $(shell command -v docker 2>/dev/null)
GIT := $(shell command -v git 2>/dev/null)
M4 := $(shell command -v m4 2>/dev/null)

DISTDIR := ./dist
VERSION_FILE = ./VERSION
DOCKERFILE := ./Dockerfile
DOCKERFILE_TEMPLATE := ./Dockerfile.m4

IMAGE_REGISTRY := docker.io
IMAGE_NAMESPACE := hectormolinero
IMAGE_NAMESPACE := hectorm
IMAGE_PROJECT := qemu-reactos
IMAGE_NAME := $(IMAGE_REGISTRY)/$(IMAGE_NAMESPACE)/$(IMAGE_PROJECT)

IMAGE_VERSION := v0
ifneq ($(wildcard $(VERSION_FILE)),)
IMAGE_VERSION := $(shell cat '$(VERSION_FILE)')
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_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).txz
IMAGE_BUILD_OPTS :=

IMAGE_NATIVE_DOCKERFILE := $(DISTDIR)/Dockerfile
IMAGE_NATIVE_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).tzst
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

export DOCKER_BUILDKIT := 1
export BUILDKIT_PROGRESS := plain

##################################################
## "all" target
##################################################

.PHONY: all
all: save-image
all: save-native-image

##################################################
## "build-*" targets
##################################################

.PHONY: build-image
build-image:
'$(DOCKER)' build \
.PHONY: build-native-image
build-native-image: $(IMAGE_NATIVE_DOCKERFILE)

$(IMAGE_NATIVE_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
'$(DOCKERFILE_TEMPLATE)' > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)' \
--tag '$(IMAGE_NAME):latest' \
--file '$(DOCKERFILE)' ./
--file '$@' ./

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

.PHONY: build-amd64-image
build-amd64-image: $(IMAGE_AMD64_DOCKERFILE)

$(IMAGE_AMD64_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
--define=CROSS_ARCH=amd64 \
'$(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
build-arm64v8-image: $(IMAGE_ARM64V8_DOCKERFILE)

$(IMAGE_ARM64V8_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
--define=CROSS_ARCH=arm64v8 \
'$(DOCKERFILE_TEMPLATE)' > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8' \
--tag '$(IMAGE_NAME):latest-arm64v8' \
--platform linux/arm64/v8 \
--file '$@' ./

##################################################
## "save-*" targets
##################################################

define save_image
'$(DOCKER)' save '$(1)' | xz -T0 > '$(2)'
'$(DOCKER)' save '$(1)' | zstd -T0 > '$(2)'
endef

.PHONY: save-image
save-image: $(IMAGE_TARBALL)
.PHONY: save-native-image
save-native-image: $(IMAGE_NATIVE_TARBALL)

$(IMAGE_TARBALL): build-image
mkdir -p '$(DISTDIR)'
$(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

.PHONY: save-amd64-image
save-amd64-image: $(IMAGE_AMD64_TARBALL)

$(IMAGE_AMD64_TARBALL): $(IMAGE_AMD64_DOCKERFILE)
$(call save_image,$(IMAGE_NAME):$(IMAGE_VERSION)-amd64,$@)

.PHONY: save-arm64v8-image
save-arm64v8-image: $(IMAGE_ARM64V8_TARBALL)

$(IMAGE_ARM64V8_TARBALL): $(IMAGE_ARM64V8_DOCKERFILE)
$(call save_image,$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8,$@)

##################################################
## "load-*" targets
##################################################

define load_image
'$(DOCKER)' load -i '$(1)'
zstd -dc '$(1)' | '$(DOCKER)' load
endef

define tag_image
'$(DOCKER)' tag '$(1)' '$(2)'
endef

.PHONY: load-image
load-image:
$(call load_image,$(IMAGE_TARBALL))
.PHONY: load-native-image
load-native-image:
$(call load_image,$(IMAGE_NATIVE_TARBALL))
$(call tag_image,$(IMAGE_NAME):$(IMAGE_VERSION),$(IMAGE_NAME):latest)

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

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

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

##################################################
## "push-*" targets
##################################################
@ -80,10 +159,41 @@ define push_image
'$(DOCKER)' push '$(1)'
endef

.PHONY: push-image
push-image:
$(call push_image,$(IMAGE_NAME):$(IMAGE_VERSION))
$(call push_image,$(IMAGE_NAME):latest)
define push_cross_manifest
'$(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 push --purge '$(1)'
endef

.PHONY: push-native-image
push-native-image:
@printf '%s\n' 'Unimplemented'

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

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

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

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)

##################################################
## "binfmt-*" targets
##################################################

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

##################################################
## "version" target
@ -91,13 +201,13 @@ push-image:

.PHONY: version
version:
@if printf -- '%s' '$(IMAGE_VERSION)' | grep -q '^v[0-9]\{1,\}$$'; then \
NEW_IMAGE_VERSION=$$(awk -v 'v=$(IMAGE_VERSION)' 'BEGIN {printf "v%.0f", substr(v,2)+1}'); \
printf -- '%s\n' "$${NEW_IMAGE_VERSION:?}" > '$(VERSION_FILE)'; \
'$(GIT)' add '$(VERSION_FILE)'; '$(GIT)' commit -m "$${NEW_IMAGE_VERSION:?}"; \
@LATEST_IMAGE_VERSION=$$('$(GIT)' describe --abbrev=0 2>/dev/null || printf 'v0'); \
if printf '%s' "$${LATEST_IMAGE_VERSION:?}" | grep -q '^v[0-9]\{1,\}$$'; then \
NEW_IMAGE_VERSION=$$(awk -v v="$${LATEST_IMAGE_VERSION:?}" 'BEGIN {printf("v%.0f", substr(v,2)+1)}'); \
'$(GIT)' commit --allow-empty -m "$${NEW_IMAGE_VERSION:?}"; \
'$(GIT)' tag -a "$${NEW_IMAGE_VERSION:?}" -m "$${NEW_IMAGE_VERSION:?}"; \
else \
>&2 printf -- 'Malformed version string: %s\n' '$(IMAGE_VERSION)'; \
>&2 printf 'Malformed version string: %s\n' "$${LATEST_IMAGE_VERSION:?}"; \
exit 1; \
fi

@ -107,5 +217,6 @@ version:

.PHONY: clean
clean:
rm -f '$(IMAGE_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

@ -6,41 +6,34 @@ A Docker image for the [ReactOS](https://www.reactos.org) operating system.
```sh
docker run --detach \
--name qemu-reactos \
--restart on-failure:3 \
--device /dev/kvm \
--publish 127.0.0.1:5900:5900/tcp \
--publish 127.0.0.1:6080:6080/tcp \
--privileged --env QEMU_KVM=true \
hectormolinero/qemu-reactos:latest
--mount type=volume,src=qemu-reactos-disk,dst=/var/lib/qemu/disk/ \
docker.io/hectorm/qemu-reactos:latest
```
> The instance will be available through a web browser from: http://localhost:6080/vnc.html

> [!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`), without password.
* **noVNC** (`6080/TCP`), http://127.0.0.1:6080/vnc.html
* `docker exec -it qemu-reactos vmshell`

## Environment variables
#### `QEMU_CPU`
#### `VM_CPU`
Number of cores the VM is permitted to use (`2` by default).

#### `QEMU_RAM`
#### `VM_RAM`
Amount of memory the VM is permitted to use (`1024M` by default).

#### `QEMU_DISK_SIZE`
VM disk size (`16G` by default).

#### `QEMU_DISK_FORMAT`
VM disk format (`qcow2` by default).

#### `QEMU_KEYBOARD`
#### `VM_KEYBOARD`
VM keyboard layout (`en-us` by default).

#### `QEMU_NET_DEVICE`
VM network device (`e1000` by default).

#### `QEMU_BOOT_ORDER`
VM boot order (`cd` by default).

#### `QEMU_BOOT_MENU`
VM boot menu (`off` by default).

#### `QEMU_KVM`
Start QEMU in KVM mode (`false` by default).
> The `--privileged` option is required to use KVM in the container.
#### `VM_KVM`
Start QEMU in KVM mode (`true` by default).
> The `--device /dev/kvm` option is required for this variable to take effect.

## License
See the [license](LICENSE.md) file.

View File

@ -1 +0,0 @@
v14

17
config/samba/smb.conf Normal file
View File

@ -0,0 +1,17 @@
[global]
server role = standalone server
interfaces = 127.0.0.1
bind interfaces only = yes
server min protocol = NT1
workgroup = WORKGROUP
security = user
map to guest = Bad User
disable netbios = yes
disable spoolss = yes
usershare max shares = 0

[share]
path = /mnt/
read only = no
guest ok = yes
force user = root

View File

@ -0,0 +1,33 @@
@echo off

:: Install srvany-ng
copy "D:\reactos\3rdParty\srvany-ng.exe" "%SystemRoot%\bin\srvany-ng.exe"

:: Install ncat
copy "D:\reactos\3rdParty\ncat.exe" "%SystemRoot%\bin\ncat.exe"

:: Install Samba
copy "D:\reactos\3rdParty\samba.exe" "%SystemRoot%\bin\samba.exe"
"%SystemRoot%\bin\samba.exe" -s

:: Install BusyBox
copy "D:\reactos\3rdParty\busybox.exe" "%SystemRoot%\bin\busybox.exe"

:: Enable BindShell
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell"
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v DisplayName /t REG_SZ /d "BindShell" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v Description /t REG_SZ /d "Allows remote access" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v ErrorControl /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v ImagePath /t REG_EXPAND_SZ /d "srvany-ng.exe" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v ObjectName /t REG_SZ /d "LocalSystem" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v Start /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell" /v Type /t REG_DWORD /d 16 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell\Parameters"
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell\Parameters" /v Application /t REG_SZ /d "%SystemRoot%\bin\ncat.exe" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell\Parameters" /v AppParameters /t REG_SZ /d "-l -k -n -e \"cmd.exe /c (cmd.exe 2^>^&1)\" 51" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BindShell\Parameters" /v AppDirectory /t REG_SZ /d "%SystemDrive%\\" /f

:: Set UTF-8 encoding in CMD
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "CHCP 65001" /f

"%SystemRoot%\system32\shutdown.exe" /s /t 5

View File

@ -0,0 +1,46 @@
[Unattend]
Signature = "$ReactOS$"

UnattendSetupEnabled = yes

DestinationDiskNumber = 0
DestinationPartitionNumber = 1
InstallationDirectory = ReactOS
AutoPartition = 1
FormatPartition = 1
; 0: FAT
; 1: BtrFS
FsType = 0
; 0: Skips MBR installation
; 1: Install MBR on floppy
; 2: Install MBR on hdd
MBRInstallType = 2

FullName = "Owner"
OrgName = "Org"
ComputerName = "REACTOS"
; AdminPassword = "password"

; TimeZoneIndex lists:
; https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912053(v=winembedded.10)
TimeZoneIndex = 85
DisableAutoDaylightTimeSet = 1

; LocaleID lists:
; https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c
LocaleID = 409

; 0: ReactOS Server
; 1: ReactOS Workstation
ProductOption = 0

DisableGeckoInst = no

[GuiRunOnce]
D:\reactos\unattend.bat

[Display]
BitsPerPel = 32
XResolution = 1440
YResolution = 900
VRefresh = 0

19
run.sh
View File

@ -6,7 +6,7 @@ export LC_ALL=C
DOCKER=$(command -v docker 2>/dev/null)

IMAGE_REGISTRY=docker.io
IMAGE_NAMESPACE=hectormolinero
IMAGE_NAMESPACE=hectorm
IMAGE_PROJECT=qemu-reactos
IMAGE_TAG=latest
IMAGE_NAME=${IMAGE_REGISTRY:?}/${IMAGE_NAMESPACE:?}/${IMAGE_PROJECT:?}:${IMAGE_TAG:?}
@ -17,31 +17,30 @@ containerExists() { "${DOCKER:?}" ps -af name="${1:?}" --format '{{.Names}}' | g
containerIsRunning() { "${DOCKER:?}" ps -f name="${1:?}" --format '{{.Names}}' | grep -Fxq "${1:?}"; }

if ! imageExists "${IMAGE_NAME:?}" && ! imageExists "${IMAGE_NAME#docker.io/}"; then
>&2 printf -- '%s\n' "\"${IMAGE_NAME:?}\" image doesn't exist!"
>&2 printf '%s\n' "\"${IMAGE_NAME:?}\" image doesn't exist!"
exit 1
fi

if containerIsRunning "${CONTAINER_NAME:?}"; then
printf -- '%s\n' "Stopping \"${CONTAINER_NAME:?}\" container..."
printf '%s\n' "Stopping \"${CONTAINER_NAME:?}\" container..."
"${DOCKER:?}" stop "${CONTAINER_NAME:?}" >/dev/null
fi

if containerExists "${CONTAINER_NAME:?}"; then
printf -- '%s\n' "Removing \"${CONTAINER_NAME:?}\" container..."
printf '%s\n' "Removing \"${CONTAINER_NAME:?}\" container..."
"${DOCKER:?}" rm "${CONTAINER_NAME:?}" >/dev/null
fi

printf -- '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..."
printf '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..."
"${DOCKER:?}" run --detach \
--name "${CONTAINER_NAME:?}" \
--hostname "${CONTAINER_NAME:?}" \
--restart on-failure:3 \
--log-opt max-size=32m \
--publish '127.0.0.1:5900:5900/tcp' \
--publish '127.0.0.1:6080:6080/tcp' \
--publish '127.0.0.1:15900:15900/tcp' \
--privileged --env QEMU_KVM=true \
--device /dev/kvm \
--publish 127.0.0.1:5900:5900/tcp \
--publish 127.0.0.1:6080:6080/tcp \
"${IMAGE_NAME:?}" "$@" >/dev/null

printf -- '%s\n\n' 'Done!'
printf '%s\n\n' 'Done!'
exec "${DOCKER:?}" logs -f "${CONTAINER_NAME:?}"

View File

@ -1,11 +0,0 @@
#!/bin/sh

set -eu

# Create ReactOS disk
if [ ! -f /var/lib/qemu/images/reactos.img ]; then
qemu-img create -f "${QEMU_DISK_FORMAT:?}" /var/lib/qemu/images/reactos.img "${QEMU_DISK_SIZE:?}"
fi

# Start all services
exec runsvdir -P /etc/service/

17
scripts/bin/container-init Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh

set -eu

stop() {
for s in "${SVDIR:?}"/*; do sv force-stop "${s:?}" >/dev/null 2>&1; done
kill -HUP "${RUNSVDIRPID:?}"; wait "${RUNSVDIRPID:?}"
}
trap stop EXIT TERM INT HUP

if [ "$#" -gt 0 ] || [ -t 0 ] || [ -t 1 ]; then
runsvdir -P "${SVDIR:?}" >/dev/null 2>&1 & RUNSVDIRPID=$!
"$@"
else
runsvdir -P "${SVDIR:?}" & RUNSVDIRPID=$!
wait "${RUNSVDIRPID:?}"
fi

12
scripts/bin/vmshell Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh

set -eu

# Wait until bind shell is available
until printf 'exit\n' | nc 127.0.0.1 5151 >/dev/null 2>&1; do sleep 1; done; sleep 1

if [ -t 0 ] || [ -t 1 ]; then
exec rlwrap nc 127.0.0.1 5151
else
exec nc 127.0.0.1 5151
fi

View File

@ -4,4 +4,4 @@ set -eu

cd /opt/novnc/utils/websockify/
exec 2>&1
exec /usr/bin/python3 -m websockify --web /opt/novnc/ 6080 localhost:5900
exec /usr/bin/python3 -m websockify --web /opt/novnc/ 6080 127.0.0.1:5900

5
scripts/service/qemu/control/t Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh

set -eu

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

View File

@ -2,17 +2,38 @@

set -eu

QEMU=$(command -v qemu-system-x86_64)
QEMU_ARGS="${QEMU_ARGS-} -smp ${QEMU_CPU:?} -m ${QEMU_RAM:?}"
QEMU_ARGS="${QEMU_ARGS-} -vga std -display vnc=:0"
QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/images/reactos.img,index=0,media=disk,format=${QEMU_DISK_FORMAT:?}"
QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/iso/reactos.iso,index=2,media=cdrom,format=raw"
QEMU_ARGS="${QEMU_ARGS-} -boot order=${QEMU_BOOT_ORDER:?},menu=${QEMU_BOOT_MENU:?},splash-time=5000"
QEMU_ARGS="${QEMU_ARGS-} -netdev user,id=n0,${QEMU_NET_OPTIONS:?} -device ${QEMU_NET_DEVICE:?},netdev=n0"
QEMU_ARGS="${QEMU_ARGS-} -usb -device usb-tablet"
QEMU_ARGS="${QEMU_ARGS-} -k ${QEMU_KEYBOARD:?}"
if [ "${QEMU_KVM:?}" = true ]; then QEMU_ARGS="${QEMU_ARGS-} -enable-kvm"; fi
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,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:?}"

if [ "${VM_KVM:?}" = true ] && [ -c /dev/kvm ]; then
set -- "$@" -accel kvm -cpu host
else
set -- "$@" -accel tcg
fi

cd_i=0
for cd in /var/lib/qemu/cd/*; do
[ -f "${cd:?}" ] || continue
set -- "$@" -device ide-cd,id=cd"${cd_i:?}",bus=ide.1,drive=cd"${cd_i:?}" -blockdev driver=raw,node-name=cd"${cd_i:?}",file.driver=file,file.filename="${cd:?}",read-only=on
cd_i="$((cd_i + 1))"
done

floppy_i=0
for floppy in /var/lib/qemu/floppy/*; do
[ -f "${floppy:?}" ] || continue
set -- "$@" -device floppy,id=floppy"${floppy_i:?}",bus=floppy-bus.0,drive=floppy"${floppy_i:?}" -blockdev driver=raw,node-name=floppy"${floppy_i:?}",file.driver=file,file.filename="${floppy:?}",read-only=on
floppy_i="$((floppy_i + 1))"
done

if [ "${cd_i:?}" -gt 0 ]; then
set -- "$@" -boot order=dc,menu=on,splash-time=5000
fi

cd /var/lib/qemu/
exec 2>&1
exec "${QEMU:?}" ${QEMU_ARGS:?}
exec /usr/bin/qemu-system-x86_64 "$@"

11
scripts/service/smbd/run Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh

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 --debug-stdout --debuglevel=3