diff --git a/Dockerfile b/Dockerfile index a82479e..586c770 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:12-slim +FROM debian:13-slim # install useful packages @@ -51,10 +51,8 @@ RUN set -eux; \ echo 'gem: --no-document' >> /usr/local/etc/gemrc # install useful ruby gems -RUN set -eux \ +RUN set -eux; \ \ - gem update --system \ - ; \ gem install -N \ bundler \ http \ @@ -63,3 +61,7 @@ RUN set -eux \ redis \ sequel \ ; + +# run all scripts in /etc/console/init/boot.d +RUN set -eux; \ + test ! -d /etc/console/init/boot.d || find /etc/console/init/boot.d -maxdepth 1 -type f -exec bash {} \; diff --git a/README.md b/README.md index 06530b7..d2933f8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,52 @@ # Console Simple console container, useful as a dev pod. + +To deploy in K8s, add the following manifest: + +```yaml +apiVersion: apps/v1 +kind: Pod +metadata: + name: console +spec: + containers: + - name: console + image: ghcr.io/bsm/console/console:latest + imagePullPolicy: Always +``` + +To execute custom commands at boot time you can include custom init scripts into a +`ConfigMap`. For example: + +```yaml +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: special-config + namespace: default +data: + 10-nproc.sh: | + #!/bin/bash + + nproc > /tmp/NPROC +--- +apiVersion: apps/v1 +kind: Pod +metadata: + name: console + namespace: console +spec: + containers: + - name: console + image: ghcr.io/bsm/console/console:latest + imagePullPolicy: Always + volumeMounts: + - mountPath: "/etc/console/init/boot.d" + name: bootd + volumes: + - name: bootd + configMap: + name: console-boot +```