Stop chowning /var in haproxy image
#
FROM openshift/origin
-#
-# Note: /var is changed to 777 to allow access when running this container as a non-root uid
-# this is temporary and should be removed when the container is switch to an empty-dir
-# with gid support.
-#
RUN INSTALL_PKGS="haproxy" && \
yum install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
@@ -17,8 +12,9 @@ RUN INSTALL_PKGS="haproxy" && \
mkdir -p /var/lib/haproxy/router/{certs,cacerts} && \
mkdir -p /var/lib/haproxy/{conf,run,bin,log} && \
touch /var/lib/haproxy/conf/{{os_http_be,os_edge_http_be,os_tcp_be,os_sni_passthrough,os_reencrypt,os_route_http_expose,os_route_http_redirect,cert_config,os_wildcard_domain}.map,haproxy.config} && \
- chmod -R 777 /var && \
- setcap 'cap_net_bind_service=ep' /usr/sbin/haproxy
+ setcap 'cap_net_bind_service=ep' /usr/sbin/haproxy && \
+ chown -R :0 /var/lib/haproxy && \
+ chmod -R g+w /var/lib/haproxy
COPY . /var/lib/haproxy/
