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: ...@@ -238,32 +238,33 @@ docs_html:
cd $(SDIR) && make html cd $(SDIR) && make html
######## ########
SECFILE = $${HOME}/.secret DKRREPO = mhastro
DOCKER_NAME = fdi DOCKER_NAME = fdi
VERS = v1.2 DVERS = v1.3
#DOCKER_NAME =httppool SEVER_NAME =httppool
#VERS = v4 SVERS = v4
PORT =9884 PORT =9884
EXTPORT =$(PORT) EXTPORT =$(PORT)
IMAGE_NAME =mhastro/$(DOCKER_NAME):$(VERS) IMAGE_NAME =$(DKRREPO)/$(DOCKER_NAME):$(VERS)
IP_ADDR =10.0.10.114 IP_ADDR =10.0.10.114
SECFILE = $${HOME}/.secret
LATEST =im:latest
B =/bin/bash B =/bin/bash
PROXIP = localhost
PROXY = --build-arg http_proxy=socks5://$(PROXIP):7777 --build-arg https_proxy=socks5://$(PROXIP):7777
PROXY =
build_docker: 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: 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: 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: 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 sleep 2
docker ps -n 1 docker ps -n 1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
FROM ubuntu:18.04 AS fdi FROM ubuntu:18.04 AS fdi
LABEL fdi 1.6 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> # 0.1 yuxin<syx1026@qq.com>
#ARG DEBIAN_FRONTEND=noninteractive #ARG DEBIAN_FRONTEND=noninteractive
#ENV TZ=Etc/UTC #ENV TZ=Etc/UTC
...@@ -94,8 +94,8 @@ USER ${USR} ...@@ -94,8 +94,8 @@ USER ${USR}
# get passwords etc from ~/.secret # get passwords etc from ~/.secret
RUN --mount=type=secret,id=envs sudo cp /run/secrets/envs . \ RUN --mount=type=secret,id=envs sudo cp /run/secrets/envs . \
&& sudo chown ${USR} envs \ && sudo chown ${USR} envs \
&& for i in `cat ./envs`; do export $i; done \ && /bin/bash -c 'for i in `cat ./envs`; do export $i; done \
&& ./dockerfile_entrypoint.sh no-run # modify pnslocal.py && ./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' #RUN bash -c 'for i in `sed -e 's/=.*$//g' ./envs`; do echo $i=${!i}, PPP ${GITPULLCSC} P%%%; done'
WORKDIR ${PKGS_DIR}/${PKG}/ 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