mbp-ubuntu/build_in_docker.sh

24 lines
565 B
Bash
Raw Normal View History

2020-04-17 05:53:48 -04:00
#!/bin/bash
set -eu -o pipefail
DOCKER_IMAGE=ubuntu:20.04
docker pull ${DOCKER_IMAGE}
2021-09-03 06:34:28 -04:00
VERSION=5
ALTERNATIVE=mbp
LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L |
grep "linux-image-${VERSION}" | grep ${ALTERNATIVE} |
grep a | cut -d'>' -f2 | cut -d'<' -f1 |sort -r | head -n 1 | cut -d'_' -f1 |
cut -d'-' -f 3-20)
echo "Using kernel ${LATEST_BUILD}"
2020-04-17 05:53:48 -04:00
docker run \
--privileged \
--rm \
-t \
-v "$(pwd)":/repo \
${DOCKER_IMAGE} \
2021-09-03 06:34:28 -04:00
/bin/bash -c "cd /repo && KERNEL_VERSION=${LATEST_BUILD} ./build.sh"