-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: yzewei <[email protected]>
- Loading branch information
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM lcr.loongnix.cn/library/alpine:3.19 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
RUN set -x \ | ||
&& addgroup -S spiped \ | ||
&& adduser -S -G spiped spiped | ||
|
||
RUN echo -e "http://10.130.0.6/alpine/edge/main/\nhttp://10.130.0.6/alpine/edge/community/\nhttp://10.130.0.6/alpine/edge/testing/" >> /etc/apk/repositories \ | ||
&& apk add --no-cache libssl1.1 \ | ||
&& sed -i '/10.130.0.6/d' /etc/apk/repositories | ||
|
||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
case "$1" in | ||
-*) set -- spiped -k /spiped/key -F "$@" ;; | ||
esac | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
umask 0077 | ||
dd if=/dev/urandom bs=32 count=1 of=/spiped/key/spiped-keyfile |