Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stefansundin/bottlerocket-bootstrap-exec-user-data

A bootstrap container for Bottlerocket that executes whatever you put in its user data.
https://github.com/stefansundin/bottlerocket-bootstrap-exec-user-data

bottlerocket

Last synced: 2 days ago
JSON representation

A bootstrap container for Bottlerocket that executes whatever you put in its user data.

Awesome Lists containing this project

README

        

This is a bootstrap container for Bottlerocket that you can use to easily run arbitrary scripts. It executes whatever you put in the user-data so you don't have to make a custom docker image for every particular thing.

The docker image is [super](Dockerfile) [simple](main.sh) and based on `debian:bookworm-slim`.

Here's an example of how to use it in your Bottlerocket user data:

```toml
[settings.bootstrap-containers.hello]
source = "public.ecr.aws/stefansundin/bottlerocket-bootstrap-exec-user-data:latest"
mode = "always"
essential = false
user-data = "IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gV29ybGQhIgo="
```

The `user-data` contains the data of file to execute (usually a bash script), encoded using base64. You can generate it like this:

```shell
cat << 'EOF' | base64
#!/bin/bash
echo "Hello World!"
EOF
```

## Troubleshooting

You can get the output from the script by running: (you may need to edit `hello` to whatever you named your bootstrap container)

```shell
enter-admin-container
sheltie
journalctl -u [email protected]
```