1
+ # ARG Definitions
2
+ # Consider adding default values for the ARGs based on this warning:
3
+ # https://github.com/hyperledger/firefly/actions/runs/10795366695/job/29941873807#step:4:171
1
4
ARG FIREFLY_BUILDER_TAG
2
5
ARG FABRIC_BUILDER_TAG
3
6
ARG FABRIC_BUILDER_PLATFORM
4
7
ARG SOLIDITY_BUILDER_TAG
5
8
ARG BASE_TAG
9
+
6
10
ARG BUILD_VERSION
7
11
ARG GIT_REF
8
12
13
+ # Firefly Builder
9
14
FROM $FIREFLY_BUILDER_TAG AS firefly-builder
10
15
ARG BUILD_VERSION
11
16
ARG GIT_REF
12
17
RUN apk add make=4.4.1-r2 \
13
18
gcc=13.2.1_git20231014-r0 \
14
19
build-base=0.5-r3 \
15
- curl=8.9.0 -r0 \
20
+ curl=8.9.1 -r0 \
16
21
git=2.43.4-r0
17
22
WORKDIR /firefly
18
23
RUN chgrp -R 0 /firefly \
@@ -26,6 +31,7 @@ RUN go mod download
26
31
ADD --chown=1001:0 . .
27
32
RUN make build
28
33
34
+ # Fabric Builder
29
35
FROM --platform=$FABRIC_BUILDER_PLATFORM $FABRIC_BUILDER_TAG AS fabric-builder
30
36
WORKDIR /firefly/smart_contracts/fabric/firefly-go
31
37
RUN chgrp -R 0 /firefly \
@@ -39,13 +45,13 @@ RUN GO111MODULE=on go mod vendor
39
45
WORKDIR /tmp/fabric
40
46
RUN curl https://github.com/hyperledger/fabric/releases/download/v2.3.2/hyperledger-fabric-linux-amd64-2.3.2.tar.gz -L --output hyperledger-fabric-linux-amd64-2.3.2.tar.gz
41
47
RUN tar -zxf hyperledger-fabric-linux-amd64-2.3.2.tar.gz
42
- ENV FABRIC_CFG_PATH /tmp/fabric/config/
48
+ ENV FABRIC_CFG_PATH= /tmp/fabric/config/
43
49
RUN ./bin/peer lifecycle chaincode package /firefly/smart_contracts/fabric/firefly-go/firefly_fabric.tar.gz --path /firefly/smart_contracts/fabric/firefly-go --lang golang --label firefly_1.0
44
50
51
+ # Solidity Builder
45
52
FROM $SOLIDITY_BUILDER_TAG AS solidity-builder
46
53
WORKDIR /firefly/solidity_firefly
47
- RUN chgrp -R 0 /firefly \
48
- && chmod -R g+rwX /firefly
54
+ RUN chgrp -R 0 /firefly && chmod -R g+rwX /firefly
49
55
ADD --chown=1001:0 smart_contracts/ethereum/solidity_firefly/ .
50
56
USER 1001
51
57
RUN mkdir -p build/contracts \
@@ -54,21 +60,23 @@ RUN mkdir -p build/contracts \
54
60
&& cd ../build/contracts \
55
61
&& mv combined.json Firefly.json
56
62
57
- FROM alpine:3.19 AS SBOM
63
+ # SBOM
64
+ FROM alpine:3.19 AS sbom
58
65
WORKDIR /
59
66
ADD . /SBOM
60
67
RUN apk add --no-cache curl
61
68
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.3
62
69
RUN trivy fs --format spdx-json --output /sbom.spdx.json /SBOM
63
70
RUN trivy sbom /sbom.spdx.json --severity UNKNOWN,HIGH,CRITICAL --exit-code 1
64
71
72
+ # Final executable build
65
73
FROM $BASE_TAG
66
74
ARG UI_TAG
67
75
ARG UI_RELEASE
68
76
RUN apk add --update --no-cache \
69
77
sqlite=3.44.2-r0 \
70
78
postgresql16-client=16.3-r0 \
71
- curl=8.9.0 -r0 \
79
+ curl=8.9.1 -r0 \
72
80
jq=1.7.1-r0
73
81
WORKDIR /firefly
74
82
RUN chgrp -R 0 /firefly \
@@ -83,10 +91,10 @@ COPY --from=firefly-builder --chown=1001:0 /firefly/firefly ./firefly
83
91
COPY --from=firefly-builder --chown=1001:0 /firefly/db ./db
84
92
COPY --from=solidity-builder --chown=1001:0 /firefly/solidity_firefly/build/contracts ./contracts
85
93
COPY --from=fabric-builder --chown=1001:0 /firefly/smart_contracts/fabric/firefly-go/firefly_fabric.tar.gz ./contracts/firefly_fabric.tar.gz
86
- ENV UI_RELEASE https://github.com/hyperledger/firefly-ui/releases/download/$UI_TAG/$UI_RELEASE.tgz
94
+ ENV UI_RELEASE= https://github.com/hyperledger/firefly-ui/releases/download/$UI_TAG/$UI_RELEASE.tgz
87
95
RUN mkdir /firefly/frontend \
88
96
&& curl -sLo - $UI_RELEASE | tar -C /firefly/frontend -zxvf -
89
- COPY --from=SBOM /sbom.spdx.json /sbom.spdx.json
97
+ COPY --from=sbom /sbom.spdx.json /sbom.spdx.json
90
98
RUN ln -s /firefly/firefly /usr/bin/firefly
91
99
USER 1001
92
100
ENTRYPOINT [ "firefly" ]
0 commit comments