1
0
mirror of https://github.com/containers/buildah.git synced 2025-04-18 07:04:05 +03:00
buildah/examples/lighttpd.sh
Tuan Anh Tran 13187f276f fix: non-portable shebang #2812
Signed-off-by: Tuan Anh Tran <me@tuananh.org>
2020-11-21 00:52:02 +07:00

19 lines
604 B
Bash
Executable File

#!/usr/bin/env bash
set -x
ctr1=$(buildah from "${1:-fedora}")
## Get all updates and install our minimal httpd server
buildah run "$ctr1" -- dnf update -y
buildah run "$ctr1" -- dnf install -y lighttpd
buildah run "$ctr1" -- mkdir /run/lighttpd
## Include some buildtime annotations
buildah config --annotation "com.example.build.host=$(uname -n)" "$ctr1"
## Run our server and expose the port
buildah config --cmd "/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf" "$ctr1"
buildah config --port 80 "$ctr1"
## Commit this container to an image name
buildah commit "$ctr1" "${2:-$USER/lighttpd}"