Commit Graph

33 Commits

Author SHA1 Message Date
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 0a1d097738 Update example to use "@HEAD"
Otherwise, we get:

> the `uses' attribute must be a path, a Docker image, or owner/repo@ref

(which the documentation implies we shouldn't, but 🤷)
2022-11-16 13:47:38 -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 9f6a35772a Implement JSON string escape in pure-awk (several orders of magnitude faster)
I've got a very pathological branch of a certain repository where this makes a parallelized (four concurrent invocations) generation change from ~3 _minutes_ down to ~13 _seconds_.
2022-07-13 16:39:56 -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 cec2d64846 Fix bug in munge-i386 2021-08-02 10:48:52 -07:00
Tianon Gravi 1da7341a79 Fix jq-template to properly count {{ }} pairs
This fixes edge cases like:

```
{{ foo }} {{ bar }} {{
    baz
    | buzz
}}
```
2021-07-16 15:34:01 -07:00
Tianon Gravi e7586033ad Add simple script for detecting the bashbrew architecture of a system 2021-03-10 10:20:13 -08:00
Tianon Gravi 00e281f36e Update "jq-template.awk" to ignore pure-comment lines
{{ # ... -}}
2021-01-21 22:11:56 -08:00
Tianon Gravi a0906cbda5 Fix typo 2020-11-09 11:08:24 -08:00
Tianon Gravi 5f0c26381f Add initial jq-template.awk 2020-08-27 15:39:03 -07: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 3ce512a383 Update example YAML from "actions/checkout@v1" to "v2" 2020-04-29 09:09:15 -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 8bc7e993ea Remove extraneous whitespace 2020-04-27 15:53:38 -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
Tianon Gravi ab90d5efb3 Perform release builds in Debian instead of Alpine 2020-04-24 12:12:59 -07:00
Tianon Gravi 6f6d9a6355 Move "bashbrew-entrypoint.sh" into scripts (not used in this repo yet) 2020-04-24 11:52:16 -07:00
Tianon Gravi 6ccbd0a7f2 Move "bashbrew-arch-to-goenv.sh" into a scripts subdirectory 2020-04-24 11:39:12 -07:00