commit 8f394f6ab6766ed200861f6ed2b8a834232a31d6 Author: Nils Freydank Date: Wed Apr 29 09:15:00 2020 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..67a0d70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# ---> Vim +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# ---> Kate +# Swap Files # +.*.kate-swp +.swp.* + +# ---> Local stuff +# Intermediate Tar archives +*.tar* diff --git a/COPYING-MIT b/COPYING-MIT new file mode 100644 index 0000000..67424f4 --- /dev/null +++ b/COPYING-MIT @@ -0,0 +1,19 @@ +Copyright 2020 Nils Freydank + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f6b3963 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# +# Dockerfile to create an alpinelinux container. +# Copyright (C) 2020 by Nils Freydank , +# published under the terms of the MIT license. +# +# Note: This copyright and license only affects the docker/podman file itself. +# The installed softwarecomponents have their own respective licsenses! + +FROM scratch as builder +ENV GLIBC_VERSION="2.31-r0" +ENV ALPINE_VERSION="3.11.6" +ENV ALPINE_ARCH="x86_64" +# Copy the rootfs from outside. +ADD alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz / + +# Create the actual image without the env/version layers. +FROM scratch +MAINTAINER Nils Freydank "nils+container@holgersson.xyz" +COPY --from=builder . . diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..63019e1 --- /dev/null +++ b/README.rst @@ -0,0 +1,43 @@ +alpine-x86_64 +============= + +This repository contains a dockerfile to create a most trustworthy base image +for further containers. The distribution `Alpine Linux`_ is used inside. + +Note that alpine linux uses the `musl libc`_, which is faster and far smaller +than the typically used glibc, but also far less supported by vendors shipping +closed source programms as pre compiled binaries. + +Usage +----- + +To build this container as a base for other images get sure wget, gnupg and +`podman`_/libpod are installed and set up. Then run the setup script + +.. code:: shell + + ./prepare-and-build.sh + +which will generate a container named alpine-${ARCH}:${VERSION}, e.g. +alpine-x86_64 (with default parameters). Note that you can overwrite the +params directly when calling the script, e.g. as + +.. code:: shell + + ARCH="x86" prepare-and-build.sh + +for a 32bit installation. + +Author and Copying +================== + +This repository is authored by `Nils Freydank`_. You can use, modify and +share this code under the terms of the MIT license (see the file +COPYING-MIT for details). + +.. links + +.. _`Alpine Linux`: https://alpinelinux.org/about/ +.. _`musl libc`: https://musl.libc.org/ +.. _`podman`: https://github.com/containers/libpod/ +.. _`Nils Freydank`: mailto:nils+container@holgersson.xyz?Subject:\ alpine\ podman diff --git a/prepare-and-build.sh b/prepare-and-build.sh new file mode 100755 index 0000000..fe63a69 --- /dev/null +++ b/prepare-and-build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Shell script to fetch and verify alpine +# Copyright 2020 by Nils Freydank , +# published according to terms of the MIT license. + +set -xeu +PATH="/usr/bin:/usr/sbin/:/bin/:/usr/bin" + +VERSION="${VERSION:-3.11.6}" +ARCH="${ARCH:-x86_64}" + +# Fetch! +wget -c http://dl-cdn.alpinelinux.org/alpine/v${VERSION%.[0-9]*}/releases/${ARCH}/alpine-minirootfs-${VERSION}-${ARCH}.tar.gz{,.asc} +# Verify! +gpg --verify alpine-minirootfs-${VERSION}-${ARCH}.tar.gz{.asc,} +# Do magic! +podman build . -t alpine-${ARCH}:${VERSION} +# Cleanup! +rm -f alpine-minirootfs-${VERSION}-${ARCH}.tar.gz{.asc,}