Commit b8f1add4 authored by M. Huang's avatar M. Huang
Browse files

fdi_no_pooldockerfile

parent 773f01e6
......@@ -232,6 +232,7 @@ docs_html:
cd $(SDIR) && make html
########
FDI_NP =mh/fdi_no_pool:v1
SERVER_NAME =httppool_server
PORT =9884
EXTPORT =$(PORT)
......@@ -256,6 +257,9 @@ secret:
@echo export MQ_PASS= >> $(SECFILE)
@cat $(SECFILE)
build_docker:
DOCKER_BUILDKIT=1 docker build -t $(FDI_NP) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) -f $(DOCKERFILE) $(D) .
build_server:
DOCKER_BUILDKIT=1 docker build -t $(IMAGE_NAME) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) -f $(DOCKERFILE) $(D) .
......
......@@ -22,7 +22,7 @@ ARG USR=apache
ARG UHOME=/home/${USR}
RUN groupadd ${USR} && useradd -g ${USR} ${USR} -m --home=${UHOME} -G sudo \
&& mkdir -p ${UHOME}/.config \
&& /bin/echo -e '\n'apache ALL = NOPASSWD: ALL >> /etc/sudoers
&& /bin/echo -e '\n'${USR} ALL = NOPASSWD: ALL >> /etc/sudoers
WORKDIR ${UHOME}
ENV PATH="${UHOME}/.local/bin:$PATH"
......
# syntax=docker/dockerfile:1.2
FROM ubuntu:18.04 AS fdi_dataset_pal
LABEL Pool Server
# 0.2-3 M. Huang <mhuang@nao.cas.cn>
# 0.1 yuxin<syx1026@qq.com>
#ARG DEBIAN_FRONTEND=noninteractive
#ENV TZ=Etc/UTC
RUN apt-get update \
&& apt-get install -y apt-utils inetutils-ping curl net-tools sudo \
&& apt-get install -y nano \
&& apt-get install -y git python3-pip
# rebuild mark
ARG re=rebuild
# setup env
# can be modified at run time
# setup user
ARG USR=fdi
ARG UHOME=/home/${USR}
RUN groupadd ${USR} && useradd -g ${USR} ${USR} -m --home=${UHOME} -G sudo \
&& mkdir -p ${UHOME}/.config \
&& /bin/echo -e '\n'${USR} ALL = NOPASSWD: ALL >> /etc/sudoers
WORKDIR ${UHOME}
ENV PATH="${UHOME}/.local/bin:$PATH"
# setup config files
COPY fdi/pns/config.py .config/pnslocal.py
# config software
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.6 0 \
&& python3 -m pip install pip -U
# convinience aliases
COPY fdi/pns/resources/profile .
RUN cat profile >> .bashrc && rm profile \
# Configure permission
RUN for i in /var/run/lock/ ${PROJ_DIR} ${UHOME}/; \
do chown -R ${USR}:${USR} $i; echo $i; done
# If install fdi repo, instead of package
# make dir for fdi.
ENV PKGS_DIR=${UHOME}
RUN mkdir -p ${PKGS_DIR} && chown ${USR}:${USR} ${PKGS_DIR}
# Run as user
USER ${USR}
# install and test fdi
ARG fd=rebuild
# If install fdi repo, instead of package
WORKDIR ${PKGS_DIR}
#RUN git clone --depth 10 -b develop http://mercury.bao.ac.cn:9006/mh/fdi.git
# from local repo
ARG PKG=fdi
COPY --chown=${USR}:${USR} ./ tmp/
RUN git clone --depth 20 -b develop file://$PWD/tmp ${PKG}
WORKDIR ${PKGS_DIR}/${PKG}/
RUN make install EXT="[DEV]" I="--user"
# If installing fdi package
# no [DEV] needed
#RUN python3 -m pip install http://mercury.bao.ac.cn:9006/mh/fdi/-/archive/develop/fdi-develop.tar.gz#egg=fdi[SERV] --user
#RUN python3 -m pip install fdi[SERV]
WORKDIR ${UHOME}
# httppool_server_entrypoint.sh is used for replacing apache listen ports and configurations of httppool_server.
USER root
USER ${USR}
# update ~/.config/pnslocal.py so test can be run with correct setting
RUN --mount=type=secret,id=envs sudo cp /run/secrets/envs . \
&& sudo chown ${USR} envs \
&& cat ./envs \
&& for i in `cat ./envs`; do export $i; done \
&& ./httppool_server_entrypoint.sh no-run
WORKDIR ${PKGS_DIR}/${PKG}/
RUN make test \
&& rm -rf ../tmp
WORKDIR ${UHOME}
RUN /bin/ls -la; \
date > build
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment