stefansundin / bottlerocket-bootstrap-exec-user-data

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

Home Page:https://gallery.ecr.aws/stefansundin/bottlerocket-bootstrap-exec-user-data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 simple and based on debian:bookworm-slim.

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

[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:

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)

enter-admin-container
sheltie
journalctl -u bootstrap-containers@hello.service

About

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

https://gallery.ecr.aws/stefansundin/bottlerocket-bootstrap-exec-user-data

License:Apache License 2.0


Languages

Language:Shell 66.0%Language:Dockerfile 34.0%