Skip to content

Commit 53963fb

Browse files
committed
docs/custom_images: Add subsections
to improve readability.
1 parent 7f06f98 commit 53963fb

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/custom_images.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<!--toc:start-->
22
- [Custom Images](#custom-images)
3+
- [Adding Dependencies to Existing Images](#adding-dependencies-to-existing-images)
4+
- [Custom Dockerfile](#custom-dockerfile)
5+
- [Custom Image](#custom-image)
36
- [Automatic Target Architecture on Debian](#automatic-target-architecture-on-debian)
47
<!--toc:end-->
58

@@ -9,6 +12,8 @@
912
README](../README.md#supported-targets). However, it can't cover every single
1013
use case out there.
1114

15+
## Adding Dependencies to Existing Images
16+
1217
If you simply need to install a dependency availaible in ubuntus package
1318
manager, see [`target.TARGET.pre-build`][config-target-pre-build]:
1419

@@ -32,9 +37,11 @@ export FREEBSD_MIRROR=$(/freebsd-fetch-best-mirror.sh) &&
3237
"""]
3338
```
3439

40+
## Custom Dockerfile
41+
3542
For other targets, or when the default image is not enough, you can use the
3643
[`target.{{TARGET}}.dockerfile`][config_target_dockerfile] field
37-
in `Cross.toml` to use custom Docker image for a specific target:
44+
in `Cross.toml` to use a custom Docker image for a specific target:
3845

3946
> *NOTE*: Refer to the [`build.dockerfile`][config_build_dockerfile] section of
4047
> the configuration for tips when writing your own `Dockerfile`.
@@ -44,16 +51,23 @@ in `Cross.toml` to use custom Docker image for a specific target:
4451
dockerfile = "Dockerfile"
4552
```
4653

47-
Or [`target.{{TARGET}}.image`][config_target_image] field in `Cross.toml` to
48-
use an already built image for the specific target:
54+
`cross` will build and use the image that was built instead of the default
55+
image.
56+
57+
58+
## Custom Image
59+
60+
If there is a pre-built image for your specific target, you can use the
61+
[`target.{{TARGET}}.image`][config_target_image] field in `Cross.toml` to use
62+
that instead:
4963

5064
``` toml
5165
[target.aarch64-unknown-linux-gnu]
5266
image = "my/image:tag"
5367
```
5468

55-
In the later example, `cross` will use a image named `my/image:tag` instead of
56-
the default one. Normal Docker behavior applies, so:
69+
In thie case, `cross` will use a image named `my/image:tag` instead of the
70+
default one. Normal Docker behavior applies, so:
5771

5872
- Docker will first look for a local image named `my/image:tag`
5973
- If it doesn't find a local image, then it will look in Docker Hub.

0 commit comments

Comments
 (0)