Sign inSign up

eskhome/alpine

By eskhome

•Updated about 6 hours ago

Alpine install from latest stable minirootfs on https://alpinelinux.org/downloads/

Image
Operating systems
0

10K+

eskhome/alpine repository overview

Script to scrape from Alpine Linux website, I have it running on a daily timer.

⁠get_alpine.sh

⁠Markdown is messing with a grep search to pull what is between a strong html tag below. To run this yourself, you will need to change 'replaceMe' in the script below to the following, but without spaces: ' ( ? < = \ < s t r o n g \ > ) . * ? ( ? = \ < \ / s t r o n g \ > ) '

#!/bin/bash

rm ncopa.asc
wget https://alpinelinux.org/keys/ncopa.asc
_question=$?
if [ "${_question}" != "0" ] ; then
  echo Unable to wget https://alpinelinux.org/keys/ncopa.asc
  exit $_question
fi
gpg --import ncopa.asc

_version=$(curl https://alpinelinux.org/downloads/ | grep "Current Alpine Version" - | grep -oP 'replaceMe')
echo ${_version} > alpine-latest-version.txt
_file=alpine-minirootfs-${_version}-x86_64.tar.gz

rm "${_file}"
wget https://uk.alpinelinux.org/alpine/latest-stable/releases/x86_64/${_file}
_question=$?
if [ "${_question}" != "0" ] ; then
  echo Unable to wget https://uk.alpinelinux.org/alpine/latest-stable/releases/x86_64/${_file}
  exit $_question
fi

rm "${_file}.asc"
wget https://uk.alpinelinux.org/alpine/latest-stable/releases/x86_64/${_file}.asc
_question=$?
if [ "${_question}" != "0" ] ; then
  echo Unable to wget https://uk.alpinelinux.org/alpine/latest-stable/releases/x86_64/${_file}.asc
  exit $_question
fi

gpg --verify "${_file}.asc" "${_file}"
_question=$?
if [ "${_question}" != "0" ] ; then
  echo Unable to gpg --verify "${_file}.asc" "${_file}"
  exit $_question
else
  mkdir "alpine-minirootfs-${_version}"
  mv -f "${_file}" "alpine-minirootfs-${_version}"
  {
    echo FROM scratch
    echo ADD \"${_file}\" /
    echo "RUN apk update; apk upgrade"
  } > "alpine-minirootfs-${_version}/Dockerfile"
  sudo ./buildandpush.sh ${_version}
  echo "Success!!"
fi

⁠buildandpush.sh

User mode read and execute only, sudo set to run this file without password for the intended user. To run yourself, change "dockerUser" to your own docker username

#!/bin/bash
_version=$1

docker build --no-cache=true -t dockerUser/alpine:minirootfs-${_version} "./alpine-minirootfs-${_version}"
docker build -t dockerUser/alpine:latest "./alpine-minirootfs-${_version}"
docker push dockerUser/alpine:minirootfs-${_version}
docker push dockerUser/alpine:latest

Tag summary

Content type

Image

Digest

sha256:24d984537…

Size

9 MB

Last updated

about 6 hours ago

docker pull eskhome/alpine