AWK命令切割字符串并返回数组
$ cat Dockerfile
#FROM amaas.lab.com:5074/dtc-devops-mailutils:release-204
FROM amaas.lab.com:5074/ubuntu-lts-jdk11:release-186
RUN mkdir -p /PROJECT
COPY target/*.jar /PROJECT/PROJECT.jar
WORKDIR /PROJECT
ENV PORT 8080
EXPOSE $PORT
ENTRYPOINT ["/bin/bash" , "-c", "/bin/wait-until-sidecar-ready.sh && java ${JAVA_OPTS} -jar PROJECT.jar"]
#ENTRYPOINT ["/bin/bash" , "-c", "/bin/wait-until-sidecar-ready.sh /bin/wait-until-sidecar-ready.sh && java ${JAVA_OPTS} -jar PROJECT.jar/bin/wait-until-sidecar-ready.sh && java ${JAVA_OPTS} -jar PROJECT.jar java -Dfile.encoding=UTF-8 -jar PROJECT.jar"]
ASIA-PACIFIC+K_Zhang@W1065HFWL3 MINGW64 ~/mydata/development/git/CIRRUS/cirrus-repository/cirrus-services/cirrus-demo-java (usr/kevin/CIRRUS-18793)
$ grep "^FROM" Dockerfile | cut -d "/" -f 2 | awk -F ":" '{split($0, arr, ":"); printf ("%s\n%s"), arr[1], arr[2]}'
ubuntu-lts-jdk11
release-186
评论前必须登录!
注册