From 5080c3e17b602e12ebe0334b565e33e635538c14 Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 2 Jun 2020 16:28:02 +0200 Subject: [PATCH] initial commit --- Dockerfile | 17 +++++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ hooks/build | 10 ++++++++++ 3 files changed, 59 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 hooks/build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2b4548f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM archlinux:latest + +ARG BUILD_DATE +ARG VCS_REF + +LABEL description="Hourly updated archlinux base image" + +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-url="https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-archlinux.git" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.license=GPL-3.0 + +WORKDIR /tmp/ +RUN pacman -Syu --noconfirm --needed && pacman --noconfirm -R $(pacman -Qdtq) || true +RUN pacman -Scc && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* \ + rm -rv /tmp/* || true +WORKDIR / diff --git a/README.md b/README.md new file mode 100644 index 0000000..1aa9031 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# docker-archlinux + +This repository provides the Dockerfile to create an updated Arch Linux base image. + +The image is rebuilt approximately every hour to ensure it always has the latest packages. + +## What you get +* updated Arch Linux [base image](https://hub.docker.com/_/archlinux) + +That's just it. This makes it possible to just grab the image and install whatever it is you want on top later. + +## Purpose +* Arch Linux image with freshly updated package base to build upon + +## Running the image +* edit the `yourlocalpath` and `containerpath` variabled or remove them entirely (along with `-v`) if you have *nothing to mount* + +```bash +docker run -it -v yourlocalpath:containerpath immawanderer/archlinux:latest +``` + +## Building the image locally +* create a new folder +* grab the Dockerfile and place it in that folder +* build the image locally + +```bash +mkdir -pv mynewfolder +cd ./mynewfolder +wget https://raw.githubusercontent.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-archlinux/master/Dockerfile +docker build --pull - < Dockerfile +``` diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..4c69a76 --- /dev/null +++ b/hooks/build @@ -0,0 +1,10 @@ +#!/bin/bash + +# as per https://github.com/rossf7/label-schema-automated-build + +# $IMAGE_NAME var is injected into the build so the tag is correct. + +echo "Build hook running" +docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + -t $IMAGE_NAME .