From a76e6a9f0f0fb018ec13b776e1544583b3b03e54 Mon Sep 17 00:00:00 2001 From: yzewei Date: Wed, 26 Jun 2024 14:41:25 +0800 Subject: [PATCH] add spiped 1.6-alpine Signed-off-by: yzewei --- library/spiped/1.6-alpine/Dockerfile | 35 +++++++++++++++++++ library/spiped/1.6-alpine/Makefile | 19 ++++++++++ .../spiped/1.6-alpine/docker-entrypoint.sh | 8 +++++ .../spiped/1.6-alpine/spiped-generate-key.sh | 3 ++ 4 files changed, 65 insertions(+) create mode 100644 library/spiped/1.6-alpine/Dockerfile create mode 100644 library/spiped/1.6-alpine/Makefile create mode 100755 library/spiped/1.6-alpine/docker-entrypoint.sh create mode 100755 library/spiped/1.6-alpine/spiped-generate-key.sh diff --git a/library/spiped/1.6-alpine/Dockerfile b/library/spiped/1.6-alpine/Dockerfile new file mode 100644 index 0000000..8bb0d0f --- /dev/null +++ b/library/spiped/1.6-alpine/Dockerfile @@ -0,0 +1,35 @@ +FROM lcr.loongnix.cn/library/alpine:3.19 + +LABEL maintainer="yangzewei@loongson.cn" + +RUN set -x \ + && addgroup -S spiped \ + && adduser -S -G spiped spiped + +ENV SPIPED_VERSION=1.6.1 SPIPED_DOWNLOAD_SHA256=8d7089979db79a531a0ecc507b113ac6f2cf5f19305571eff1d3413e0ab33713 + +RUN set -x \ + && apk add --no-cache --virtual .build-deps \ + curl \ + gcc \ + make \ + musl-dev \ + openssl-dev \ + tar \ + && curl -fsSL "https://www.tarsnap.com/spiped/spiped-$SPIPED_VERSION.tgz" -o spiped.tar.gz \ + && echo "$SPIPED_DOWNLOAD_SHA256 *spiped.tar.gz" |sha256sum -c - \ + && mkdir -p /usr/local/src/spiped \ + && tar xzf "spiped.tar.gz" -C /usr/local/src/spiped --strip-components=1 \ + && rm "spiped.tar.gz" \ + && CC=gcc make -C /usr/local/src/spiped \ + && make -C /usr/local/src/spiped install \ + && rm -rf /usr/local/src/spiped \ + && apk del .build-deps + +VOLUME /spiped +WORKDIR /spiped + +COPY *.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["spiped"] diff --git a/library/spiped/1.6-alpine/Makefile b/library/spiped/1.6-alpine/Makefile new file mode 100644 index 0000000..d1a462e --- /dev/null +++ b/library/spiped/1.6-alpine/Makefile @@ -0,0 +1,19 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=spiped +TAG?=1.6-alpine + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +image: + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) diff --git a/library/spiped/1.6-alpine/docker-entrypoint.sh b/library/spiped/1.6-alpine/docker-entrypoint.sh new file mode 100755 index 0000000..bd200c4 --- /dev/null +++ b/library/spiped/1.6-alpine/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +case "$1" in + -*) set -- spiped -k /spiped/key -F "$@" ;; +esac + +exec "$@" diff --git a/library/spiped/1.6-alpine/spiped-generate-key.sh b/library/spiped/1.6-alpine/spiped-generate-key.sh new file mode 100755 index 0000000..3ce7d10 --- /dev/null +++ b/library/spiped/1.6-alpine/spiped-generate-key.sh @@ -0,0 +1,3 @@ +#!/bin/sh +umask 0077 +dd if=/dev/urandom bs=32 count=1 of=/spiped/key/spiped-keyfile