diff --git a/Dockerfile b/Dockerfile index 21f740a..46d31ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,14 @@ -FROM archlinux -RUN pacman -Syu --noconfirm --needed gcc cmake make git valgrind && pacman -Scc && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* +FROM archlinux/base + +ENV container=docker + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-url="https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-archlinux-cdev.git" \ + org.label-schema.vcs-ref=$VCS_REF + +RUN pacman -Syu --noconfirm --needed gcc cmake make git valgrind \ + && pacman -Scc \ + && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* diff --git a/README.md b/README.md index fa3e7d3..f9621dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -# docker-archlinux-cdev [![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-archlinux-cdev/status.svg?ref=refs/heads/master)](https://drone.dotya.ml/wanderer/docker-archlinux-cdev) +# docker-archlinux-cdev + +[![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-archlinux-cdev/status.svg?ref=refs/heads/master)](https://drone.dotya.ml/wanderer/docker-archlinux-cdev) This repository provides the Dockerfile to create a Docker image used for light C development (some goodies included). +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) @@ -12,5 +15,3 @@ This repository provides the Dockerfile to create a Docker image used for light ## Purpose * light C development upon fresh package base - -Enjoy. 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 .