forked from dcermak/container-layer-sizes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (33 loc) · 1.47 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
40
41
42
43
44
45
FROM registry.suse.com/bci/golang:1.17 as go-builder
WORKDIR /app/
COPY . /app/
RUN zypper -n ref && \
zypper -n in --allow-downgrade libgpgme-devel libassuan-devel libbtrfs-devel device-mapper-devel awk
RUN go build ./bin/analyzer && go build ./bin/storage
RUN for lib in $(ldd analyzer |grep '=>'|awk '{print $3}'); do \
pkg=$(rpm -q --whatprovides $lib); \
if [[ ! $pkg =~ glibc ]]; then zypper download $pkg; fi; \
done
FROM registry.suse.com/bci/node:16 as node-builder
WORKDIR /app/
COPY . /app/
RUN npm -g install yarn && yarn install && yarn run buildProduction
FROM registry.suse.com/bci/bci-micro:15.3 as storage-backend-deploy
WORKDIR /app/
COPY --from=go-builder /app/storage .
EXPOSE 4040
ENTRYPOINT ["/app/storage"]
FROM registry.suse.com/bci/bci-minimal:15.3 as deploy
WORKDIR /app/
COPY --from=go-builder /app/analyzer .
COPY --from=node-builder /app/public/ public/
COPY --from=go-builder /var/cache/zypp/packages/SLE_BCI/x86_64/ .
RUN rpm -i --nodeps --force *rpm && rm -rf *rpm
RUN mkdir -p /etc/containers/ /var/lib/containers/storage /var/run/containers/storage && \
echo '{"default":[{"type":"insecureAcceptAnything"}],"transports":{"docker-daemon":{"":[{"type":"insecureAcceptAnything"}]}}}' > /etc/containers/policy.json && \
echo $'[storage] \n\
driver = "vfs" \n\
runroot = "/var/run/containers/storage" \n\
graphroot = "/var/lib/containers/storage"' > /etc/containers/storage.conf
EXPOSE 5050
ENTRYPOINT ["/app/analyzer", "--no-rootless"]