Skip to content

Commit

Permalink
spice-proxy: move spice-proxy to kubevirt repository
Browse files Browse the repository at this point in the history
- add spice-proxy Dockerfile
- run spice-proxy as non-root user, part of the fix for kubevirt#113

Signed-off-by: Lukianov Artyom <[email protected]>
  • Loading branch information
Lukianov Artyom committed Jul 3, 2017
1 parent 0102edd commit 19331a7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hack/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
binaries="cmd/virt-controller cmd/virt-launcher cmd/virt-handler cmd/virt-api cmd/virtctl cmd/virt-manifest"
docker_images="$binaries images/haproxy images/iscsi-demo-target-tgtd images/vm-killer images/libvirt-kubevirt"
docker_images="$binaries images/haproxy images/iscsi-demo-target-tgtd images/vm-killer images/libvirt-kubevirt images/spice-proxy"
docker_prefix=kubevirt
docker_tag=${DOCKER_TAG:-latest}
manifest_templates="`ls manifests/*.in`"
Expand Down
19 changes: 19 additions & 0 deletions images/spice-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM centos:7.2.1511

MAINTAINER Roman Mohr <[email protected]>

EXPOSE 3128

RUN yum install -y squid && yum clean all

RUN sed -i -e "s/http_access deny CONNECT !SSL_ports/http_access deny CONNECT !Safe_ports/" /etc/squid/squid.conf
RUN echo "pid_filename /home/proxy/run/squid.pid" >> /etc/squid/squid.conf

RUN useradd --create-home -s /bin/bash proxy
RUN chown -R proxy /var/log/squid && chown -R proxy /var/spool/squid
RUN cp /etc/squid/squid.conf /home/proxy && chown proxy /home/proxy/squid.conf
WORKDIR /home/proxy
USER proxy
RUN mkdir /home/proxy/run

CMD squid -NCd1 -f /home/proxy/squid.conf
4 changes: 3 additions & 1 deletion manifests/squid.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ spec:
spec:
containers:
- name: spice-proxy
image: rmohr/spice-squid:latest
image: {{ docker_prefix }}/spice-proxy:{{ docker_tag }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3128
name: "spice-proxy"
protocol: "TCP"
securityContext:
runAsNonRoot: true
nodeSelector:
kubernetes.io/hostname: master

0 comments on commit 19331a7

Please sign in to comment.