Commit Graph

518 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
yosifkit efe1fec23b
Merge pull request #64 from infosiftr/no-docker-inside-oci
Perform more strict validation of *all* media types
2023-01-31 13:37:14 -08:00
Tianon Gravi 057b5986a3 Perform more strict validation of *all* media types
Docker media types inside OCI media types is semantically fine (and Docker sure doesn't care), but technically invalid, so this increases our validation from just the manifest media type all the way down to the config and layer media types also.
2023-01-31 13:03:50 -08:00
Tianon Gravi 82fa443ede
Merge pull request #63 from infosiftr/fetch
Add "bashbrew fetch" command
2023-01-31 08:50:27 -08:00
Tianon Gravi cec429fa53 Add "gitCache" template function
This not only returns the path to the "git cache" directory, but ensures it is initialized and that `git` commands against it will generally succeed.
2023-01-30 14:25:51 -08:00
Tianon Gravi c7d3d0d935 Add "bashbrew fetch" command
In many, many, many scripts I have encoded the horrible assumption that `ArchDockerFroms` will ensure our Git repository is fetched (which is a side-effect of that function).  With the implementation of `Builder: oci-import`, that side effect is not necessary for returning an accurate result in these new images.  Instead of working around this in bad ways, I've decided to finally bite the bullet and add an explicit `bashbrew fetch` command that can make sure all the underlying Git commits are fully fetched into the local cache.
2023-01-30 14:01:10 -08:00
Tianon Gravi 5990aceab3
Merge pull request #62 from infosiftr/go-mod-update
Update Go deps
2022-12-22 09:42:17 -08:00
Tianon Gravi b38cded65d Update Go deps 2022-12-21 14:45:09 -08:00
Tianon Gravi e5a5d7d72a Bump version to 0.1.8 (post-release) 2022-12-19 11:10:57 -08:00
yosifkit 026ccf128d
Merge pull request #61 from infosiftr/oci-import
Add "Builder: oci-import" support
2022-12-16 16:36:30 -08:00
Tianon Gravi 449eb48090 Add "path.Clean" and more comments in gitfs's "resolveSymlink" function 2022-12-16 09:09:58 -08:00
Tianon Gravi c9bc568661 Adjust "ociImportBuild" error messages to be more debugging-friendly 2022-12-15 14:48:59 -08:00
Tianon Gravi 8660e6021a Fix "re-tagging bug" by abusing `docker build` to multi-tag a single-line synthetic `Dockerfile` 2022-12-15 11:42:13 -08:00
Tianon Gravi 99c15f44c2 Fix "gitfs"'s "Mode()" function and transparently follow symlinks 2022-12-15 11:42:13 -08:00
Tianon Gravi b96445ff59 Fix edge case with previously (failed) ingested content 2022-12-15 11:42:13 -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 18db6c5617
Merge pull request #60 from infosiftr/containerd-helpers
Use containerd helper functions I didn't notice before in registry/
2022-12-01 11:13:15 -08:00
Tianon Gravi 6d8e83b90c Use containerd helper functions I didn't notice before in registry/ 2022-11-30 16:43:10 -08:00
Tianon Gravi c896b4da42 Bump version to 0.1.7 (post-release) 2022-11-18 17:45:34 -08:00
yosifkit f95be1e3f9
Merge pull request #59 from infosiftr/manifest-tests
Add more test coverage for manifest/
2022-11-17 16:46:11 -08:00
yosifkit 6acd73c061
Merge pull request #56 from infosiftr/bashbrew-remote-arches
Add new "bashbrew remote arches" command
2022-11-17 16:33:40 -08:00
Tianon Gravi 419da33551 Add more test coverage for manifest/ 2022-11-17 16:10:52 -08:00
Tianon Gravi 20b5a50a4e Bump version to 0.1.6 (post-release) 2022-11-17 10:30:41 -08:00
Tianon Gravi b20e82cb0d Add new "bashbrew remote arches" command
This command will, given a remote image reference, look up the list of platforms from it and match them to supported bashbrew architectures (providing content descriptors for each).

Also, refactor registry code to be more correct: previously, this couldn't fetch from Docker without `DOCKERHUB_PUBLIC_PROXY` (see `registry-1.docker.io` change) and was ignoring content digests.  Now it works correctly with or without `DOCKERHUB_PUBLIC_PROXY`, verifies the size of every object it pulls, verifies the digest, _and_ should continue working with the in-progress Moby containerd-integration (where the local image ID becomes the digest of the manifest or index instead of the digest of the config blob as it is today).
2022-11-16 15:31:47 -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
yosifkit 4f4ad25eba
Merge pull request #57 from infosiftr/github-composite-action
Add initial "composite" action for installing Bashbrew
2022-11-16 13:42:02 -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
yosifkit b8eda2b2f6
Merge pull request #55 from infosiftr/parent-children-rewrite
Rewrite "bashbrew children" and "bashbrew parents"
2022-11-15 17:22:32 -08:00
Tianon Gravi f54c8e397a Rewrite "bashbrew children" and "bashbrew parents"
This time, they are distinct implementations because the problem they are solving is inherently different.

For listing children of a given name, we *have* to walk the entire library (since we only have tag -> FROM mappings, not the reverse, which is fundamentally the question that "children" answers).

On the flip side, listing the parents of a given name is as straightforward as looking up the FROM values and walking until we can't anymore.

In my own testing, these new implementations are significantly more correct, and handle more edge cases (including things we couldn't support before like `bashbrew children --depth=1 scratch`, `bashbrew children mcr.microsoft.com/windows/servercore`, etc).

They also more correctly handle edge cases like tags that are `FROM` a "`SharedTag`" such that they don't walk up/down both sides of the tree (for example, `orientdb:3.2` -> `FROM eclipse-temurin:8-jdk`, which is both Windows *and* Linux, even though `orientdb:3.2` is Linux-only).
2022-11-14 14:32:20 -08:00
Tianon Gravi 8281cbe661 Make "codecov" upload failures fail the CI so we notice 2022-11-03 15:14:45 -07:00
yosifkit 220052c1e0
Merge pull request #53 from infosiftr/oci-platform-test
Add very basic "oci-platform" string test
2022-11-03 14:23:38 -07:00
Tianon Gravi d0452fbee0 Add very basic "oci-platform" string test 2022-11-02 12:55:19 -07:00
Tianon Gravi 634e28feca Update from "tianon/docker-tianon" to "infosiftr/moby" (which is the successor to the prior image) 2022-10-24 16:46:23 -07:00
Tianon Gravi a4cf783b66 Bump version to 0.1.5 (post-release) 2022-10-24 15:41:05 -07:00
Tianon Gravi 1d0cd64256 Fix typos from #52 🙈 2022-10-14 16:50:46 -07:00
yosifkit bb6adab397
Merge pull request #52 from infosiftr/buildkit
Set BASHBREW_BUILDKIT_SYNTAX and respect "Builder:" in GitHub Actions scripts
2022-10-14 14:39:22 -07:00
Tianon Gravi 3c04396218 Set BASHBREW_BUILDKIT_SYNTAX and respect "Builder:" in GitHub Actions scripts 2022-10-13 17:22:42 -07:00
yosifkit f09bb954ef
Merge pull request #43 from jedevc/docker-buildx
Buildkit support with buildx
2022-09-23 11:08:13 -07:00
Justin Chadwell bf9186987f buildkit: configure dockerfile syntax from environment
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-09-20 16:55:41 +01:00
Justin Chadwell 981ff1d376 buildkit: introduce initial support
This patch adds a new `Builder` entry to the RFC2822 image manifest
files, allowing individual image components to opt into buildkit
support, using docker buildx.

Additionally, docker build is changed to explicitly set
DOCKER_BUILDKIT=0 to force a non-buildkit build in preparation for
the switching default in any upcoming docker versions.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-09-20 16:55:23 +01:00
Tianon Gravi cb560812a9
Merge pull request #49 from infosiftr/go-update
Periodic update: go to version 1.18
2022-07-21 11:20:57 -07:00
Joe Ferguson 444b05a2d7 Periodic update to keep go version current 2022-07-21 10:05:05 -07:00
Tianon Gravi 3a1bc49181
Merge pull request #48 from infosiftr/pure-awk-json-string-escaping
Implement JSON string escape in pure-awk (several orders of magnitude faster)
2022-07-13 16:56:38 -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 b4cc436456
Merge pull request #47 from infosiftr/local-tests
Add explicit support to GitHub Actions scripts for ".test/config.sh" …
2022-06-24 11:10:32 -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
yosifkit b4880ac5f1
Merge pull request #45 from infosiftr/single-line
Finally deprecate the legacy line-based format
2022-06-08 17:20:59 -07:00
Tianon Gravi 69f43237ee Finally deprecate the legacy line-based format 2022-06-08 16:41:02 -07:00