Skip to content

Commit 20a6a37

Browse files
committed
Update the build docs to explain how to build all the new images
1 parent f423e4f commit 20a6a37

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

docs/modules/ROOT/pages/docker-build.adoc

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ So you don’t trust downloading Docker images from the web, eh? You are
44
right! No one should trust _the internet_!
55

66
Our images are built and pushed using Github Actions. You can manually
7-
check if the images are being tampered by doing the followings:
7+
check if the images are being tampered with by doing the following:
88

99
* Head over to the https://github.com/games-on-whales/gow/runs/[`Actions`] section on Github and open up the build that you want to check
1010
* For each generated Docker image there’s a step called `Image digest`
@@ -34,14 +34,55 @@ gameonwhales/xorg:sha-98e5080
3434
Digest:sha256:6b8555260ed07c7ed466e0b821922a3cedf4ee27b9d6b8fea9d6aa2995b75f61
3535
....
3636

37-
=== I don’t trust you, let me build the images myself
37+
=== I don’t trust you, can't I just build the images myself?
3838

39-
You sure can! We use docker buildkit – make sure it’s installed in your
40-
environment. In order to build it locally run:
39+
You sure can! Here's what you'll need to know.
4140

41+
==== Base Images
42+
43+
We have two images that are only used as the base for our other images; they
44+
aren't ever launched by themselves and therefore they don't appear in the
45+
compose files. Since they don't appear in the compose files, `docker compose`
46+
can't automatically build them. Instead, you must specify which images to use
47+
as environment variables, found in `env/build.env`.
48+
49+
If you want to build the base images yourself too, that's no problem. First
50+
build the `base` image:
51+
[source,bash]
52+
....
53+
sudo DOCKER_BUILDKIT=1 docker build -t my-gow-base images/base
54+
....
55+
56+
Then the `base-app` image, passing the `base` image you just built as a build arg:
57+
[source,bash]
58+
....
59+
sudo DOCKER_BUILDKIT=1 docker build --build-arg BASE_IMAGE=my-gow-base -t my-gow-base-app images/base-app
60+
....
61+
62+
Lastly, edit `env/build.env` to specify your newly built images to be used for
63+
future compose builds:
64+
[source,bash]
65+
....
66+
BUILD_BASE_IMAGE=my-gow-base
67+
BUILD_BASE_APP_IMAGE=my-gow-base-app
68+
....
69+
70+
You can, of course, choose any tags you like instead of `my-gow-base` and `my-gow-base-app`.
71+
72+
==== App and System Images
73+
74+
Any of the app or system images described in the compose files can be easily
75+
built using the `run-gow` script. First, edit the appropriate compose YAML files
76+
and uncomment the `build:` section, to let `docker compose` know you want to
77+
build those images rather than pulling it from a registry. You may also want to
78+
comment out the `image:` lines to make sure there's no confusion.
79+
80+
Then, build the images you've chosen by running `run-gow`:
4281
[source,bash]
4382
....
44-
sudo COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 run-gow [options] build
83+
sudo run-gow [options] build
4584
....
4685

47-
You should call `run-gow` with the same options you plan to run apps with; specifically, be sure to use the right combination of `--gpu`, `--headless`, and `--app`.
86+
You should call `run-gow` with the same options you plan to run apps with;
87+
specifically, be sure to use the right combination of `--gpu`, `--headless`,
88+
and `--app`.

images/base-app/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
ARG BUILD_OWNER
2-
ARG BUILD_TAG
3-
FROM ghcr.io/${BUILD_OWNER}/base:${BUILD_TAG}
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
43

54
ARG DEBIAN_FRONTEND=noninteractive
65

0 commit comments

Comments
 (0)