标签:user star use account .com conf tap cal sed
源由不表,暂且略过。 直接说workaround.
$ oc create serviceaccount useroot $ oc adm policy add-scc-to-user anyuid -z useroot $ oc patch dc/mytomcat --patch ‘{"spec":{"template":{"spec":{"serviceAccountName": "useroot"}}}}‘
[root@master tomcat]# cat Dockerfile FROM docker-registry.default.svc:5000/myproject/tomcat:8-slim COPY startapp.sh /usr/local/tomcat/bin/startapp.sh CMD ["/usr/local/tomcat/bin/startapp.sh"]
其中startapp.sh为
[root@master tomcat]# cat startapp.sh #!/bin/bash echo "startup ...." cp /etc/resolv.conf /etc/resolv.conf1 sed -i "s/:5/:5 single-request/" /etc/resolv.conf1 cp /etc/resolv.conf1 /etc/resolv.conf /usr/local/tomcat/bin/catalina.sh run
docker build -t docker-registry.default.svc:5000/myproject/mytomcat:8-slim . docker push docker-registry.default.svc:5000/myproject/mytomcat:8-slim
查看结果
标签:user star use account .com conf tap cal sed
原文地址:https://www.cnblogs.com/ericnie/p/10223674.html