build new letsencrypt tool image
This commit is contained in:
20
dockerfiles/tasks/letsencrypt-2/Dockerfile
Normal file
20
dockerfiles/tasks/letsencrypt-2/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM ubuntu:focal
|
||||
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>
|
||||
|
||||
WORKDIR /opt/project
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
\
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
|
||||
ARG script_dir=/usr/local/bin/acme-nginx
|
||||
RUN wget https://github.com/kshcherban/acme-nginx/releases/download/v0.1.2/acme-nginx \
|
||||
-O ${script_dir}
|
||||
RUN chmod +x ${script_dir}
|
||||
|
||||
ENV TERM=xterm
|
||||
ENTRYPOINT ["/usr/local/bin/acme-nginx"]
|
||||
48
dockerfiles/tasks/letsencrypt-2/build.sh
Executable file
48
dockerfiles/tasks/letsencrypt-2/build.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
LOCAL_IMAGE=xaicorp/acme-nginx
|
||||
REMOTE_IMAGE=dkregistry.xai-corp.net:5000/xaicorp/acme-nginx
|
||||
|
||||
build() {
|
||||
docker build --rm -f Dockerfile -t xaicorp/acme-nginx .
|
||||
}
|
||||
|
||||
build_test() {
|
||||
echo testing the image
|
||||
docker run --rm --entrypoint=ls $LOCAL_IMAGE -l /usr/local/bin | grep acme-nginx
|
||||
docker run --rm -it $LOCAL_IMAGE -h
|
||||
docker run --rm -it $LOCAL_IMAGE -h | grep 'usage: acme-nginx'
|
||||
}
|
||||
|
||||
build_deploy() {
|
||||
echo push to registry
|
||||
|
||||
docker tag $LOCAL_IMAGE $REMOTE_IMAGE
|
||||
docker push $REMOTE_IMAGE
|
||||
}
|
||||
|
||||
print_usage() {
|
||||
printf "Usage: %s: [-b] [-t] [-d] \n" "$0"
|
||||
echo -b build
|
||||
echo -t test
|
||||
echo -d push to registry
|
||||
echo -h help
|
||||
exit 0
|
||||
}
|
||||
|
||||
######
|
||||
if [ -z "$1" ]; then
|
||||
build && build_test && build_deploy
|
||||
exit
|
||||
fi
|
||||
|
||||
while getopts btdh name
|
||||
do
|
||||
case $name in
|
||||
b) build;;
|
||||
t) build_test;;
|
||||
d) build_deploy;;
|
||||
*) print_usage;;
|
||||
esac
|
||||
done
|
||||
Reference in New Issue
Block a user