Skip to content

Commit

Permalink
Fix and modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
dubo-dubon-duponey committed Mar 16, 2024
1 parent f6b3c7d commit 01d964f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ FROM ${_private_df:-scratch}
SHELL ["/bin/bash", "-o", "errexit", "-o", "errtrace", "-o", "functrace", "-o", "nounset", "-o", "pipefail", "-c"]

# > If the image is built from snapshot.debian.org (eg: if the TARGET_REPOSITORY secret has NOT been set), this will fetch from that date
ARG TARGET_DATE="2021-07-01"
ARG TARGET_DATE="2024-03-01"
# > Which Debian suite to fetch (same as above)
ARG TARGET_SUITE="bullseye"
ARG TARGET_SUITE="bookworm"

# > This is tricky: repeat ARG, so that we can access the value of FROM_IMAGE_BUILDER below
ARG _private_df
# If _DEBOOTSTRAP_FROM is set, then set the tarball to nonexistent* (glob is here to prevent a hard error with Docker)
# Now, if there is no _DEBOOTSTRAP_FROM (which happens if FROM_REGISTRY is neutered), then use a bullseye tarball from 2021-07-01
# Now, if there is no _DEBOOTSTRAP_FROM (which happens if FROM_REGISTRY is neutered), then use a bookworm tarball from 2024-03-01
# (that is expected to have been built)
ENV FROM_TARBALL="${_private_df:+nonexistent*}"
ENV FROM_TARBALL="${FROM_TARBALL:-bullseye-2021-07-01.tar}"
ENV FROM_TARBALL="${_private_df:+.gitkeep}"
ENV FROM_TARBALL="${FROM_TARBALL:-bookworm-2024-03-01.tar}"

# > Optionally, the final content to commit to etc/apt/sources.list in the debootstrap
# If this is not set, /etc/apt/sources.list will point to either snapshot.debian.org or YOURREPO if you were using TARGET_REPOSITORY=TARGET_REPOSITORY/foo
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ Build

```bash
./hack/build.sh debootstrap \
--inject date="2021-08-01" \
--inject suite="bullseye"
--inject date="2024-03-01" \
--inject suite="bookworm"
```

Assemble and push
Assemble and push

```bash
./hack/build.sh debian \
--inject date="2021-08-01" \
--inject suite="bullseye" \
--inject date="2024-03-01" \
--inject suite="bookworm" \
```

Note that the above will by default try to push to `docker.io/dubodubonduponey/debian`.
Expand All @@ -54,16 +54,16 @@ You can control additional aspects of the build passing arguments:
Building a subset of architectures:
```bash
./hack/build.sh debootstrap \
--inject date="2021-08-01" \
--inject suite="bullseye" \
--inject date="2024-03-01" \
--inject suite="bookworm" \
--inject platforms="linux/arm/v6"
```

Building from a private debian repository instead:
```bash
./hack/build.sh debootstrap \
--inject date="2021-08-01" \
--inject suite="bullseye" \
--inject date="2024-03-01" \
--inject suite="bookworm" \
--inject repository="https://private.deb.repo/debian/foo/bar"
```

Expand All @@ -75,8 +75,8 @@ Building offline:

# Now, you can build without access to a registry
./hack/build.sh debootstrap \
--inject date="2021-08-01" \
--inject suite="bullseye" \
--inject date="2024-03-01" \
--inject suite="bookworm" \
--inject registry=""

# You can further control networking and other build aspect through a cue environment (see ADVANCED)
Expand Down
Empty file.
Empty file.

0 comments on commit 01d964f

Please sign in to comment.