-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (31 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM enclaive/gramine-os:latest
ENV DEBIAN_FRONTEND noninteractive
ARG DOCKER_IP_ADDRESS=10.5.0.5
RUN apt-get update -y && apt-get install -y \
openssl \
apt-utils \
software-properties-common
# download mosquitto
RUN add-apt-repository ppa:mosquitto-dev/mosquitto-ppa && apt-get update -y && apt install -y mosquitto
# add configs
WORKDIR /etc/mosquitto
COPY conf/mosquitto.conf .
COPY conf/default.conf ./conf.d/
# add or generate self-signed certificate
WORKDIR /etc/mosquitto
COPY ssl/ca_certificates/ca.crt ./ca_certificates/ca.crt
COPY ssl/server_certs/server.crt ./certs/server.crt
COPY ssl/server_certs/server.key ./certs/server.key
COPY ssl/conf ./conf
COPY ssl/cert-gen.sh .
RUN chmod +x cert-gen.sh && ./cert-gen.sh
# sign manifest
WORKDIR /manifest
COPY mosquitto.manifest.template .
RUN gramine-argv-serializer "mosquitto" "-c" "/etc/mosquitto/mosquitto.conf" "-v" > trusted_argv \
&& ./manifest.sh mosquitto
# open listener ports
EXPOSE 1883
EXPOSE 8883
ENTRYPOINT [ "/entrypoint/enclaive.sh" ]
CMD ["mosquitto", "-c", "/etc/mosquitto/mosquitto.conf", "-v"]