Commit Graph

24 Commits

Author SHA1 Message Date
Tianon Gravi d64a9e81b0 Fix behavior around `BASHBREW_LIBRARY` in GHA
This script needs/uses a custom `BASHBREW_LIBRARY` directory, but it stores that value in the exported environment slightly too soon such that `generate-stackbrew-library.sh` picks it up (and shouldn't be).

We often use "`BASHBREW_LIBRARY` is unset (or empty)" as a conditional for whether to fall back to using "https://github.com/docker-library/official-images/raw/HEAD/library/" as an explicit prefix for querying "source of truth" values for things like supported parent architectures.

These two things collided in cc2dc88e04 (and similar commits) because the script saw `BASHBREW_LIBRARY` set, trusted it, but then fails to find the parent image.

This is the cleanest place to fix this such that `generate-stackbrew-library.sh` can take `BASHBREW_LIBRARY` from the provided environment instead of using our generated value.
2024-09-30 11:46:48 -07:00
Tianon Gravi 0e6bdaabd6 Add "--platform" to GHA generate script 2023-09-14 16:17:49 -07:00
Tianon Gravi 044742f698 Update GHA scripts to use `bashbrew-buildkit-env-setup.sh`
If our DOI checkout includes the new `bashbrew-buildkit-env-setup.sh` script, we should use it to set up our buildkit-related environment variables.
2023-03-15 16:53:20 -07:00
Tianon Gravi abdd412027 Udpate "github-actions/generate.sh" script to use "gitCache" and "bashbrew fetch"
This *should* be generally safe since we got most/all downstream consumers to pin to a release (or they're building bashbrew from the same commit they're getting the script from).
2023-02-01 10:28:09 -08:00
Tianon Gravi 0b7ae64b2f Add "Builder: oci-import" support
In the case of base images (`debian`, `alpine`, `ubuntu`, etc), using a `Dockerfile` as our method of ingestion doesn't really buy us very much.  It made sense at the time it was implemented ("all `Dockerfile`, all the time"), but at this point they're all some variation on `FROM scratch \n ADD foo.tar.xz / \n CMD ["/bin/some-shell"]`, and cannot reasonably be "rebuilt" when their base image changes (which is one of the key functions of the official images) since they _are_ the base images in question.

Functionally, consuming a tarball in this way isn't _that_ much different from consuming a raw tarball that's part of, say, an OCI image layout (https://github.com/opencontainers/image-spec/blob/v1.0.2/image-layout.md) -- it's some tarball plus some metadata about what to do with it.

For less trivial images, there's a significant difference (and I'm not proposing to use this for anything beyond simple one-layer base images), but for a single layer this would be basically identical.

As a more specific use case, the Debian `rootfs.tar.xz` files are currently [100% reproducible](https://github.com/debuerreotype/debuerreotype).  Unfortunately, some of that gets lost when it gets imported into Docker, and thus it takes some additional effort to get from the Docker-generated rootfs back to the original debuerreotype-generated file.

This adds the ability to consume an OCI image directly, to go even further and have a 100% fully reproducible image digest as well, which makes it easier to trace a given published image back to the reproducible source generated by the upstream tooling (especially if a given image is also pushed by the maintainer elsewhere).

Here's an example `oci-debian` file I was using for testing this:

    Maintainers: Foo (@bar)
    GitRepo: https://github.com/tianon/docker-debian-artifacts.git
    GitFetch: refs/heads/oci-arm32v5
    Architectures: arm32v5
    GitCommit: d6ac440e7760b6b16e3d3da6f2b56736b9c10065
    Builder: oci-import
    File: index.json

    Tags: bullseye, bullseye-20221114, 11.5, 11, latest
    Directory: bullseye/oci

    Tags: bullseye-slim, bullseye-20221114-slim, 11.5-slim, 11-slim
    Directory: bullseye/slim/oci
2022-12-15 11:42:10 -08:00
Tianon Gravi 0feb2b9342 Fix depth check 2022-11-16 15:31:25 -08:00
Tianon Gravi ba00ac06de Add initial "composite" action for installing Bashbrew
(Also, fix a few minor bugs in `scripts/github-actions/generate.sh` and update the example appropriately)
2022-11-16 13:20:29 -08:00
Tianon Gravi 1d0cd64256 Fix typos from #52 🙈 2022-10-14 16:50:46 -07:00
Tianon Gravi 3c04396218 Set BASHBREW_BUILDKIT_SYNTAX and respect "Builder:" in GitHub Actions scripts 2022-10-13 17:22:42 -07:00
Tianon Gravi 92ab34bccf Remove pgp-happy-eyeballs entirely
This is a follow-up to https://github.com/docker-library/bashbrew/pull/34
2022-06-27 15:10:38 -07:00
Tianon Gravi 4632bf0ecd Add explicit support to GitHub Actions scripts for ".test/config.sh" (and ".test/tests/xxx/") 2022-06-21 15:03:11 -07:00
Tianon Gravi 2eebccf6b6 Remove support for ltsc2016 (EOL) in GitHub Actions script
See https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/base-image-lifecycle
2022-01-12 13:57:07 -08:00
Tianon Gravi 875dcb4f08 Fix edge case around "bashbrew from" failing to create Git cache 2021-12-01 12:06:38 -08:00
Tianon Gravi a690dddbea Add BASHBREW_GENERATE_SKIP_PGP_PROXY variable to skip pgp-happy-eyeballs 2021-08-26 16:06:30 -07:00
Fabian Grutschus a4a65a7293
Added support for Windows Server 2022 to `generate.sh` (#33) 2021-08-24 14:38:50 -07:00
Tianon Gravi a0906cbda5 Fix typo 2020-11-09 11:08:24 -08:00
Tianon Gravi 68878f489c Make sure "froms" list is unique (so we don't waste time doing "docker pull" on the same thing twice, in some edge cases) 2020-04-29 14:28:31 -07:00
Tianon Gravi 9f67c3e82a Fix "git fetch" to unshallow if possible too 2020-04-29 11:25:55 -07:00
Tianon Gravi 1f5a50dd45 Fix "docker build --file" (relative to "Directory") 2020-04-28 17:08:03 -07:00
Tianon Gravi abb0e55f11 Adjust GitHub Actions to "git fetch" the current repository's history into the Bashbrew cache when the commits appear to be unreachable (such as on a PR branch, for example) 2020-04-28 14:25:39 -07:00
Tianon Gravi b22f02ed1b Skip "docker pull" on scratch 2020-04-27 17:21:19 -07:00
Tianon Gravi 53b96a62f1 Adjust Bashbrew building logic to be less noisy if called multiple times (quietly adjust PATH if bashbrew is already built) 2020-04-27 17:21:13 -07:00
Tianon Gravi dd71778b05 Account for BASHBREW_NAMESPACE to support non-library use cases too 2020-04-27 15:41:37 -07:00
Tianon Gravi 3af45bd402 Add initial scripts for image maintainers to use to auto-generate appropriate GitHub Actions 2020-04-27 15:22:33 -07:00