Commit Graph

493 Commits

Author SHA1 Message Date
Tianon Gravi a0ec8ceff9 Add several improvements to GHA example
- "workflow_dispatch" so we can trigger manually
- "concurrency" so we avoid over-triggering when updating PRs/branches
- multi-line string in GITHUB_OUTPUT for better output and less flakiness
2023-07-18 09:00:08 -07:00
Tianon Gravi a67d6088ac
Merge pull request #76 from infosiftr/go-bump
Bump go version to 1.20
2023-05-04 22:51:34 +00:00
Joseph Ferguson 9128f86f3f Bump go version to 1.20 2023-05-04 15:36:42 -07:00
yosifkit 9b8e397a59
Merge pull request #75 from infosiftr/dirmngr
Remove explicit `dirmngr` reference
2023-04-28 17:07:52 -07:00
Tianon Gravi 50f732f60c Remove explicit `dirmngr` reference
This is pulled in automatically via `gnupg`, and moved from `Recommends` to `Depends` in 99474ad900, which has been part of `src:gnupg2` since 2.1.21-4 (and every supported version of both Debian _and_ Ubuntu have 2.2.x 😇).
2023-04-28 15:33:16 -07:00
yosifkit ab914dfaa8
Merge pull request #74 from infosiftr/avoid-platforms.Default
Avoid platforms.Default by passing arch down earlier
2023-04-07 14:26:04 -07:00
Tianon Gravi 706a814612 Avoid platforms.Default by passing arch down earlier 2023-04-07 12:16:00 -07:00
yosifkit e2e6171ada
Merge pull request #73 from infosiftr/bbolt-err
Return "bbolt" errors consistently
2023-04-07 12:15:50 -07:00
Tianon Gravi 92859565ab Return "bbolt" errors consistently
Also, scope our internal containerd content store to `BASHBREW_ARCH` so that there's less lock contention on builds that happen to share a machine.
2023-04-07 12:03:09 -07:00
Tianon Gravi d88bd1bb84
Merge pull request #72 from infosiftr/update-containerd-bbolt
Update containerd to v1.6.19, bbolt to v1.3.7
2023-03-24 14:51:32 -07:00
Tianon Gravi 822e692761 Update containerd to v1.6.19, bbolt to v1.3.7 2023-03-24 13:39:23 -07:00
Tianon Gravi 6e7f235231
Merge pull request #70 from infosiftr/bashbrew-buildkit-envs
Update GHA scripts to use `bashbrew-buildkit-envs.sh`
2023-03-20 13:34:16 -07:00
Tianon Gravi f7f54c2f83
Merge pull request #71 from infosiftr/continue-pushing
Fix bug that causes `bashbrew push` to only push the first item
2023-03-20 10:22:44 -07:00
Tianon Gravi eefda401da Fix bug that causes `bashbrew push` to only push the first item 2023-03-20 10:11:56 -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 296033e201
Merge pull request #69 from infosiftr/buildx-sbom
Add support for BASHBREW_BUILDKIT_SBOM_GENERATOR and provenance
2023-03-03 09:19:05 -08:00
Tianon Gravi eeaf85b4d2 Add support for BASHBREW_BUILDKIT_SBOM_GENERATOR and provenance
Since Docker's image store can't represent these, we round trip them through our self-managed (or external) containerd image store, which also makes pushing more efficient.
2023-03-02 14:40:46 -08:00
Tianon Gravi d7cd73aca8
Merge pull request #68 from infosiftr/containerd-canonical
Correctly store "canonical" image refs in containerd's image store
2023-02-22 16:44:02 -08:00
Tianon Gravi 419bd042db Correctly store "canonical" image refs in containerd's image store
In other words, instead of `ubuntu:22.04`, we should store it as `docker.io/library/ubuntu:22.04` (which Docker then converts appropriately on `docker load`).
2023-02-22 16:18:20 -08:00
Tianon Gravi c42713594f
Merge pull request #67 from infosiftr/cves
Update to newer containerd and go/x/net to pull in fixes for GO-2023-1573 and GO-2023-1571
2023-02-22 10:26:46 -08:00
Tianon Gravi 59444a000d Update to newer containerd and go/x/net to pull in fixes for GO-2023-1573 and GO-2023-1571
- https://pkg.go.dev/vuln/GO-2023-1573
- https://pkg.go.dev/vuln/GO-2023-1571

(verified with govulncheck before and after)
2023-02-22 10:08:24 -08:00
Tianon Gravi 6177415d06
Merge pull request #66 from infosiftr/fetch-failures-context
Add more context to "git fetch" failures
2023-02-21 16:27:41 -08:00
Tianon Gravi 34166dbd71 Add more context to "git fetch" failures
This makes it a lot easier to see/debug what's going wrong:

```console
$ BASHBREW_CACHE=/tmp/foo bashbrew fetch --arch-filter ubuntu:bionic
failed fetching git repo for "ubuntu" (tags "18.04, bionic-20230126, bionic" on arch "amd64")
failed fetching "f127810992c0981574cc137b9c83937ca1a304dc:refs/remotes/temp3848952252/temp": server does not support exact SHA1 refspec
failed finding Git commit "f127810992c0981574cc137b9c83937ca1a304dc" after fetching "refs/tags/dist-bionic-amd64-20230126:refs/remotes/temp3848952252/temp": object not found
```
2023-02-15 14:50:14 -08:00
Tianon Gravi d5c8f9af30 Bump version to 0.1.9 (post-release) 2023-02-15 13:20:20 -08:00
yosifkit 7e160dca31
Merge pull request #65 from infosiftr/gitCache
Udpate "github-actions/generate.sh" script to use "gitCache" and "bashbrew fetch"
2023-02-03 16:32:24 -08: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
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