diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d8fe4fa70f618843e9ab2df67167b49565c71f25 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.project diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..800b1695e41e3f6ba650bb51242ff3fbf8f17070 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM debian:10.7 + +ARG FAAS_SHIB_IMAGE +ARG FAAS_SHIB_NAME +ARG FAAS_SHIB_VERSION + +RUN echo $FAAS_SHIB_IMAGE > /faas-docker-image +RUN echo $FAAS_SHIB_NAME > /faas-docker-name +RUN echo $FAAS_SHIB_VERSION > /faas-docker-version + +COPY ./conf/etc/apt/sources.list /etc/apt/sources.list + +RUN apt-get -q update && \ + apt-get install -y --no-install-recommends apt-utils curl vim rsyslog && \ + apt-get install -y libapache2-mod-shib shibboleth-sp-utils shibboleth-sp-common && \ + apt-get --yes install supervisor && \ + apt-get clean + +#ENTRYPOINT ["/etc/entrypoint"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..dfe1660806f485c346e65b953afbc85f2519b05b --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +# import config file +config ?= conf/faas-shib.cnf +include $(config) +export $(shell sed 's/=.*//' $(config)) + + +.DEFAULT_GOAL := help + +build: # build container + docker build -t ${FAAS_SHIB_IMAGE} --build-arg FAAS_SHIB_NAME=${FAAS_SHIB_NAME} --build-arg FAAS_SHIB_IMAGE=${FAAS_SHIB_IMAGE} --build-arg FAAS_SHIB_VERSION=${FAAS_SHIB_VERSION} . + +build-nc: # build container without caching + docker build --no-cache -t ${FAAS_SHIB_IMAGE} --build-arg FAAS_SHIB_NAME=${FAAS_SHIB_NAME} --build-arg FAAS_SHIB_IMAGE=${FAAS_SHIB_IMAGE} --build-arg FAAS_SHIB_VERSION=${FAAS_SHIB_VERSION} . + +run: # run container + docker run -i -t --detach --rm --env-file=$(config) --name="${FAAS_SMTP_NAME}" ${FAAS_SHIB_IMAGE} + +run-nd: # run container in no-deamon mode + docker run -i -t --rm --env-file=$(config) --name="${FAAS_SHIB_NAME}" ${FAAS_SHIB_IMAGE} + +up: build run # build and run container + +logs: # print docker logs + docker logs ${FAAS_SHIB_NAME} + +stop: # stop container + docker stop ${FAAS_SHIB_NAME} + +version: # print current component version + @echo ${FAAS_SHIB_VERSION} + +help: # this help + @awk 'BEGIN {FS = ":.*?# "} /^[a-zA-Z_-]+:.*?# / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) diff --git a/README.md b/README.md index e2372d90d61b424368675ce8df0195342466fd65..90a9fd21a3a957a078f6c097a6343029751e6ec9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# FaaS-shib +# FaaS-SHIB +Build docker image with sebian (10.7) and Shibboleth Service Provider (3.2.0) + +## structure +`_conf/`_ - directory with configuration files + + +## build image +To build `faas-shib` docker image +` +make build +` + + +## run image +To run `faas-shib` docker image +` +make run +` + +## additional commands +``` +build build container +build-nc build container without caching +run run container +run-nd run container in no-deamon mode +up build and run container +logs print docker logs +stop stop container +version print current component version +``` + diff --git a/conf/etc/apt/sources.list b/conf/etc/apt/sources.list new file mode 100644 index 0000000000000000000000000000000000000000..972f651b859786a33b379deb06d3151ab765adcd --- /dev/null +++ b/conf/etc/apt/sources.list @@ -0,0 +1,6 @@ +# deb http://snapshot.debian.org/archive/debian/20210111T000000Z buster main +deb http://deb.debian.org/debian testing main +# deb http://snapshot.debian.org/archive/debian-security/20210111T000000Z buster/updates main +deb http://security.debian.org/debian-security buster/updates main +# deb http://snapshot.debian.org/archive/debian/20210111T000000Z buster-updates main +deb http://deb.debian.org/debian buster-updates main diff --git a/conf/faas-shib.cnf b/conf/faas-shib.cnf new file mode 100644 index 0000000000000000000000000000000000000000..4de5cdedf034294e26104fbab88bde5846a0953d --- /dev/null +++ b/conf/faas-shib.cnf @@ -0,0 +1,5 @@ +FAAS_SHIB_REPO=faas +FAAS_SHIB_NAME=faas-shib +FAAS_SHIB_VERSION=1.0-SNAPSHOT +FAAS_SHIB_IMAGE=${FAAS_SHIB_REPO}/${FAAS_SHIB_NAME}:${FAAS_SHIB_VERSION} +