diff --git a/bincompat-nginx/.gitignore b/bincompat-nginx/.gitignore new file mode 100644 index 00000000..902b58e3 --- /dev/null +++ b/bincompat-nginx/.gitignore @@ -0,0 +1,2 @@ +workdir/ +rootfs/extracted_rootfs/ diff --git a/bincompat-nginx/rootfs/Dockerfile b/bincompat-nginx/rootfs/Dockerfile new file mode 100644 index 00000000..14af0e1c --- /dev/null +++ b/bincompat-nginx/rootfs/Dockerfile @@ -0,0 +1,11 @@ +FROM nginx:1.25 + +RUN mkdir -p /rootfs/usr/sbin /rootfs/etc/nginx /rootfs/usr/share/nginx/html /rootfs/var/log/nginx /rootfs/var/run /rootfs/tmp /rootfs/lib + +RUN cp /usr/sbin/nginx /rootfs/usr/sbin/ +RUN cp -r /etc/nginx/* /rootfs/etc/nginx/ +RUN cp -r /usr/share/nginx/html/* /rootfs/usr/share/nginx/html/ + +RUN echo "daemon off;" >> /rootfs/etc/nginx/nginx.conf + +RUN ldd /usr/sbin/nginx | grep -o '/lib/[^ ]*' | xargs -I {} cp {} /rootfs/lib/ diff --git a/bincompat-nginx/rootfs/Makefile b/bincompat-nginx/rootfs/Makefile new file mode 100644 index 00000000..8d69f7ba --- /dev/null +++ b/bincompat-nginx/rootfs/Makefile @@ -0,0 +1,13 @@ +ROOTFS_DIR := ./extracted_rootfs +DOCKER_IMAGE := nginx-catalog-core-rootfs + +.PHONY: all clean + +all: + docker build -t $(DOCKER_IMAGE) . + docker create --name temp-container $(DOCKER_IMAGE) + docker cp temp-container:/rootfs $(ROOTFS_DIR) + docker rm temp-container + +clean: + rm -rf $(ROOTFS_DIR)