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

bash for export in dockerfile

parent d5a7fe72
......@@ -238,32 +238,33 @@ docs_html:
cd $(SDIR) && make html
########
SECFILE = $${HOME}/.secret
DKRREPO = mhastro
DOCKER_NAME = fdi
VERS = v1.2
#DOCKER_NAME =httppool
#VERS = v4
DVERS = v1.3
SEVER_NAME =httppool
SVERS = v4
PORT =9884
EXTPORT =$(PORT)
IMAGE_NAME =mhastro/$(DOCKER_NAME):$(VERS)
IMAGE_NAME =$(DKRREPO)/$(DOCKER_NAME):$(VERS)
IP_ADDR =10.0.10.114
SECFILE = $${HOME}/.secret
LATEST =im:latest
B =/bin/bash
PROXIP = localhost
PROXY = --build-arg http_proxy=socks5://$(PROXIP):7777 --build-arg https_proxy=socks5://$(PROXIP):7777
PROXY =
build_docker:
DOCKER_BUILDKIT=1 docker build -t $(DOCKER_NAME):$(VERS) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) $(PROXY) $(D) --progress=plain .
DOCKER_BUILDKIT=1 docker build -t $(DOCKER_NAME):$(DVERS) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) $(D) --progress=plain .
docker tag $(DOCKER_NAME):$(DVERS) $(LATEST)
launch_docker:
docker run -dit --network=bridge --env-file $(SECFILE) --name $(DOCKER_NAME) $(D) $(DOCKER_NAME):$(VERS) $(L)
docker run -dit --network=bridge --env-file $(SECFILE) --name $(DOCKER_NAME):$(DVERS) $(D) $(LATEST) $(LAU)
build_server:
DOCKER_BUILDKIT=1 docker build -t $(DOCKER_NAME):$(VERS) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) --progress=plain -f fdi/pns/resources/httppool_server_2.docker $(D) .
DOCKER_BUILDKIT=1 docker build -t $(SERVER_NAME):$(SVERS) --secret id=envs,src=$${HOME}/.secret --build-arg fd=$(fd) --build-arg re=$(re) $(D) --progress=plain .
docker tag $(SERVER_NAME):$(SVERS) $(LATEST)
launch_server:
docker run -d -it --network=bridge -p $(PORT):$(EXTPORT) --env-file $(SECFILE) --name $(DOCKER_NAME) $(D) $(DOCKER_NAME):$(VERS) $(L)
docker run -dit --network=bridge --env-file $(SECFILE) --name $(SERVER_NAME):$(SVERS) $(D) $(LATEST) $(LAU)
sleep 2
docker ps -n 1
......
......@@ -2,7 +2,7 @@
FROM ubuntu:18.04 AS fdi
LABEL fdi 1.6
# 1- M. Huang <mhuang@nao.cas.cn>
# 1-1.3 M. Huang <mhuang@nao.cas.cn>
# 0.1 yuxin<syx1026@qq.com>
#ARG DEBIAN_FRONTEND=noninteractive
#ENV TZ=Etc/UTC
......@@ -94,8 +94,8 @@ USER ${USR}
# get passwords etc from ~/.secret
RUN --mount=type=secret,id=envs sudo cp /run/secrets/envs . \
&& sudo chown ${USR} envs \
&& for i in `cat ./envs`; do export $i; done \
&& ./dockerfile_entrypoint.sh no-run # modify pnslocal.py
&& /bin/bash -c 'for i in `cat ./envs`; do export $i; done \
&& ./dockerfile_entrypoint.sh no-run' # modify pnslocal.py
#RUN bash -c 'for i in `sed -e 's/=.*$//g' ./envs`; do echo $i=${!i}, PPP ${GITPULLCSC} P%%%; done'
WORKDIR ${PKGS_DIR}/${PKG}/
......
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