You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/packages.md
+32-3Lines changed: 32 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ We do not want the builds to happen with each CI run for two reasons:
23
23
1. It is slower to do a package build than to just pull the latest image.
24
24
2. If any of the steps of the build fails, e.g. a `curl` download that depends on an intermittent target, it can cause all of CI to fail.
25
25
26
-
Thus, if, as a maintainer, you merge any commits into a `pkg/`, even if the change is documentation alone, please do a `linuxkit package push`.
26
+
Thus, if, as a maintainer, you merge any commits into a `pkg/`, even if the change is documentation alone, please do a `linuxkit pkg push`.
27
27
28
28
29
29
## Package source
@@ -54,8 +54,8 @@ A package source consists of a directory containing at least two files:
54
54
### Prerequisites
55
55
56
56
Before you can build packages you need:
57
-
- Docker version 17.06 or newer. If you are on a Mac you also need
58
-
`docker-credential-osxkeychain.bin`, which comes with Docker for Mac.
57
+
- Docker version 19.03 or newer, which includes [buildx](https://docs.docker.com/buildx/working-with-buildx/)
58
+
- If you are on a Mac you also need`docker-credential-osxkeychain.bin`, which comes with Docker for Mac.
59
59
-`make`, `notary`, `base64`, `jq`, and `expect`
60
60
- A *recent* version of `manifest-tool` which you can build with `make
61
61
bin/manifest-tool`, or `go get github.com:estesp/manifest-tool`, or
@@ -67,6 +67,35 @@ Further, when building packages you need to be logged into hub with
67
67
`docker login` as some of the tooling extracts your hub credentials
68
68
during the build.
69
69
70
+
### Build Targets
71
+
72
+
LinuxKit builds packages as docker images. It deposits the built package as a docker image in one of two targets:
73
+
74
+
* the linuxkit cache `~/.linuxkit/` (configurable) - default option
75
+
* the docker image cache
76
+
77
+
If you want to build images and test and run them _in a standalone_ fashion locally, then you should pick the docker image cache. Otherwise, you should use the default linuxkit cache. LinuxKit defaults to building OS images using docker images from this cache,\
78
+
only looking in the docker cache if instructed to via `linuxkit build --docker`.
79
+
80
+
When using the linuxkit cache as the package build target, it creates all of the layers, the manifest that can be uploaded
81
+
to a registry, and the multi-architecture index. If an image already exists for a different architecture in the cache,
82
+
it updates the index to include additional manifests created.
83
+
84
+
As of this writing, `linuxkit pkg build` only builds packages for the platform on which it is running; it does not (yet) support cross-building the packages for other architectures.
85
+
86
+
Note that the local docker option is available _only_ when building without pushing to a remote registry, i.e.:
87
+
88
+
```
89
+
linuxkit pkg build
90
+
linuxkit pkg build --docker
91
+
```
92
+
93
+
If you push to a registry, it _always_ uses the linuxkit cache only:
94
+
95
+
```
96
+
linuxkit pkg push
97
+
```
98
+
70
99
### Build packages as a maintainer
71
100
72
101
If you have write access to the `linuxkit` organisation on hub, you
0 commit comments