Commit graph

27 commits

Author SHA1 Message Date
Gerald Pinder
3a0be4099a
feat: Add bootc support (#448)
Adds support for using `bootc` as the preferred method for booting from
a locally created image. This new method gets rid of the need to create
a tarball and move it to the correct place and instead it will make use
of `podman scp` which copies the image to the root `containers-storage`
and then has `rpm-ostree` and `bootc` boot from that store.

Closes #418 
Closes #200
2025-08-09 14:05:59 -04:00
Gerald Pinder
d4e05c3f11 fix: Remove bootc check for now since it's causing problems 2025-06-02 08:47:46 -04:00
Gerald Pinder
cfc2806715 fix: Remove /usr/etc in cleanup since it's not used by bootc 2025-05-31 17:03:11 -04:00
Gerald Pinder
099da7167c fix: Needs to be bootc container lint 2025-05-31 16:09:56 -04:00
Gerald Pinder
9418955e52 chore: Add bootc lint 2025-05-31 14:07:28 -04:00
Gerald Pinder
33bebb5e29 fix: Parse Version from container and remove ostree commit 2025-05-31 00:45:23 -04:00
Gerald Pinder
f3d6fecbd5 fix: Get os ID with built-ins 2025-04-15 17:50:54 -04:00
Gerald Pinder
74bd05643f feat: Add support for NuShell scripts 2025-01-05 13:31:29 -05:00
fiftydinar
974ba34225 chore: Use consistent syntax for getting information from os-release
Please tell me if I escaped quotes correctly in `drivers.rs`
2024-12-13 12:35:30 -05:00
Gerald Pinder
2069eb513a chore: Prepare for the v0.9.0 release 2024-12-03 03:49:37 -05:00
fiftydinar
1cc8b69e4a chore: Assure that get_json_array outputs compact json output
This fixes the issue with `files` module, where brackets are included in an array.
2024-12-01 08:06:35 -05:00
Gerald Pinder
f2a4123e0b fix: Export get_json_array bash function 2024-11-25 22:18:21 -05:00
Gerald Pinder
de3becfe2d fix: Make sure jq prints raw values 2024-11-25 14:11:12 -05:00
Gerald Pinder
20550f22aa chore: Add get_json_array bash function for migration to jq 2024-11-25 13:00:46 -05:00
fiftydinar
990269e574 chore: Remove unneded comment about bootupctl command
Not needed to be done anymore, as it's done upstream.

So removing the comment.
2024-11-25 12:48:30 -05:00
Gerald Pinder
0de0417515 chore: Install jq and prefer over yq for modules 2024-11-24 11:14:00 -05:00
Gerald Pinder
75eae89e4a feat: Add platform arg to force building a specific architecture 2024-10-03 14:47:47 -04:00
Gerald Pinder
f0679fdd11 chore: Remove bootupctl until issue is resolved 2024-09-28 20:21:21 -04:00
Gerald Pinder
5cf1ce66a0 chore: Check for bootupctl in post-build script 2024-09-24 20:57:23 -04:00
Gerald Pinder
741ec811df fix: May not be possible to just install bootc, run bootupctl if bootc already exists 2024-09-23 12:01:46 -04:00
Gerald Pinder
de45aeb015 fix: Add post build script to prepare image for ISO creation 2024-09-16 16:19:00 -04:00
Gerald Pinder
4634f40840 fix: Make build fail if module fails 2024-09-03 10:54:01 -04:00
Gerald Pinder
74d99f2b17 feat: Color output in terminal if running in TTY 2024-08-30 23:40:53 -04:00
Gerald Pinder
8069006c03
feat: Stages (#173)
## Stages

A new property (`stages`) is being added to the recipe file schema. This
property will allow users to define a list of Containerfile stages each
with their own modules. Stages can be used to compile programs, perform
parallel operations, and copy the results into the final image without
contaminating the final image.

### Module Support

Currently the only modules that work out-of-the-box are `copy`,
`script`, `files`, and `containerfile`. Other modules are dependent on
the programs installed on the image. In order to better support some of
our essential modules, a setup script is ran at the start of each stage
that is not `scratch`. This script will install `curl`, `wget`, `bash`,
and `grep` and use the package manager for the detected distributions.

At this time, the following distributions are supported:

- Debian
- Ubuntu
- Fedora
- Alpine

Contributions to increase the size of this list is
[welcome](https://github.com/blue-build/cli)!

### Syntax

- **Required**
- `from` - The full image ref (image name + tag). This will be set in
the `FROM` statement of the stage.
- `name` - The name of the stage. This is used when referencing the
stage when using the `from:` property in the `copy` module.
- `modules` - The list of modules to execute. The exact same syntax used
by the main recipe `modules:` property.
- **Optional**
- `shell` - Allows a user to pass in an array of strings that are passed
directly into the [`SHELL`
instruction](https://docs.docker.com/reference/dockerfile/#shell).

#### Example

```yaml
stages:
- name: ubuntu-test
  from: ubuntu
  modules:
  - type: files
    files:
    - usr: /usr
  - type: script
    scripts:
    - example.sh
    snippets:
    - echo "test" > /test.txt
  - type: test-module
  - type: containerfile
    containerfiles:
    - labels
    snippets:
    - RUN echo "This is a snippet"
```

### Tasks
- [x] `from-file:` - Allows the user to store their stages in a separate
file so it can be included in multiple recipes
- [x] `no-cache:` - This will be useful for stages that want to pull the
latest changes from a git repo and not have to rely on the base image
getting an update for the build to be triggered again.
- [x] Add setup script to be able to install necessary programs to run
`bluebuild` modules in stages
- [x] Check for circular dependencies and error out

## `copy` module

This is a 1-1 for the [`COPY`
instruction](https://docs.docker.com/reference/dockerfile/#copy). It has
the ability to copy files between stages, making this a very important
addition to complete functionality for the stages feature. Each use of
this "module" will become its own layer.

### Decision to use `--link`

We use the `--link`
[option](https://docs.docker.com/reference/dockerfile/#benefits-of-using---link)
which allows that layer to have the same hash if the files haven't
changed regardless of if the previous instructions have changed. This
allows these layers to not have to be re-downloaded on the user's
computer if the copied files haven't changed.

### Syntax

- **Required**
- `src` - The source directory/file from the repo OR when `from:` is set
the image/stage that is specified.
  - `dest` - The destination directory/file inside the working image.
- **Optional**
  - `from` - The stage/image to copy from.

#### Example

```yaml
modules:
- type: copy
  from: ubuntu-test
  src: /test.txt
  dest: /
```

### Tasks
- [x] make `from:` optional
- [x] Add README.md and module.yml

## Feature gating

Gating this feature until we release for `v0.9.0`. The plan will be to
build all features (including this one) for main branch builds. This
means that these features will be available when using the `main` image
and consequently the `use_unstable_cli:` option on the GitHub Action.
All future `v0.9.0` features will be gated as well to allow for patches
to `v0.8`.

### Tasks
- [x] Build `--all-features` on non-tagged builds
- [x] Add stages and copy features
2024-05-18 13:23:50 +00:00
Gerald Pinder
7ce0ad7cf8
chore: Remove title case (#177) 2024-05-05 00:47:54 -04:00
Gerald Pinder
0b5e7599f8 fix: Fix flatpak module errors 2024-04-28 18:56:11 -04:00
Gerald Pinder
0c7033ccd2
feat: Move module run logic into its own script (#168)
This will help make the Containerfile just a little bit easier to read
(ignoring all the mounts lol). This would also allow us to add logic
later to support modules that run executables other than `*.sh`.
2024-04-27 15:19:58 -04:00