-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (31 loc) · 1.52 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
39
FROM alpine
LABEL org.opencontainers.image.authors="Alan Ip <[email protected]>" \
org.opencontainers.image.source="https://github.com/theipster/aws-cloudformation-graphviz"
# Init user, install packages
RUN addgroup -S app && \
adduser -u 1001 -D -S -G app app && \
apk add --no-cache gettext graphviz jq ttf-opensans
# Download AWS icon pack
RUN wget https://d1.awsstatic.com/webteam/architecture-icons/AWS-Architecture-Icons_PNG_20200430.1f43d2dd713164497d228e77bd7542ff7b504bd4.zip -O aws-png-icons.zip && \
echo "1f43d2dd713164497d228e77bd7542ff7b504bd4 aws-png-icons.zip" | sha1sum -c && \
mkdir -v /var/cache/aws-png-icons/ && \
unzip -jnq aws-png-icons.zip -x */.DS_Store */._* -d /var/cache/aws-png-icons/ && \
du -sh /var/cache/aws-png-icons/ && \
rm -v aws-png-icons.zip
# Copy executables
WORKDIR /etc/aws-cloudformation-graphviz
COPY examples/ examples/
COPY src/ src
COPY templates/ templates
# Link executables
RUN ln -s /etc/aws-cloudformation-graphviz/src/aws-cloudformation-graphviz.sh /usr/bin/aws-cloudformation-graphviz && \
ln -s /etc/aws-cloudformation-graphviz/src/graphviz/edge.sh /usr/bin/aws-cloudformation-graphviz-edge && \
ln -s /etc/aws-cloudformation-graphviz/src/graphviz/graph.sh /usr/bin/aws-cloudformation-graphviz-graph && \
ln -s /etc/aws-cloudformation-graphviz/src/graphviz/node.sh /usr/bin/aws-cloudformation-graphviz-node
# Run tests
COPY tests.sh .
RUN ./tests.sh
USER app
WORKDIR /home/app
ENTRYPOINT ["aws-cloudformation-graphviz"]
CMD ["-Tpng"]