Repository navigation
Expand file tree
/
Copy pathEarthfile
More file actions
156 lines (120 loc) · 4.7 KB
/
Copy pathEarthfile
File metadata and controls
156 lines (120 loc) · 4.7 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
VERSION 0.8
wallet-ui-build:
FROM node:20-slim
WORKDIR /app
COPY wallet-ui/package.json wallet-ui/package-lock.json ./
RUN npm ci
COPY wallet-ui/ ./
RUN npx vite build --outDir dist
SAVE ARTIFACT dist /wallet
cli-java:
ARG EARTHLY_TARGET_NAME
ARG EARTHLY_GIT_SHORT_HASH
ARG APP_VERSION
FROM eclipse-temurin:21
COPY . .
COPY +wallet-ui-build/wallet src/main/resources/static/wallet
RUN echo git.commit.id.abbrev=${EARTHLY_GIT_SHORT_HASH} > src/main/resources/git.properties
RUN cat src/main/resources/git.properties
RUN echo "Tag value is ${tag}"
RUN --mount=type=cache,target=/root/.gradle ./gradlew --no-daemon -i -Pversion=${APP_VERSION} clean build
RUN ls build/libs
SAVE ARTIFACT build/libs/yaci-cli-${APP_VERSION}.jar yaci-cli.jar
cli-native:
ARG EARTHLY_TARGET_NAME
ARG EARTHLY_GIT_SHORT_HASH
ARG APP_VERSION
FROM ghcr.io/graalvm/graalvm-community:21
COPY . .
COPY +wallet-ui-build/wallet src/main/resources/static/wallet
RUN echo git.commit.id.abbrev=${EARTHLY_GIT_SHORT_HASH} > src/main/resources/git.properties
RUN cat src/main/resources/git.properties
RUN echo "Tag value is ${tag}"
RUN --mount=type=cache,target=/root/.gradle ./gradlew --no-daemon -i -Pversion=${APP_VERSION} clean build nativeCompile
SAVE ARTIFACT build/native/nativeCompile/yaci-cli yaci-cli
SAVE ARTIFACT build/libs/yaci-cli-${APP_VERSION}.jar yaci-cli.jar
cli-native-ci:
LOCALLY
ARG EARTHLY_TARGET_NAME
ARG EARTHLY_GIT_SHORT_HASH
ARG APP_VERSION
RUN ./gradlew --no-daemon -i -Pversion=${APP_VERSION} clean build nativeCompile
SAVE ARTIFACT build/native/nativeCompile/yaci-cli yaci-cli
SAVE ARTIFACT build/libs/yaci-cli-${APP_VERSION}.jar yaci-cli.jar
java-setup:
FROM eclipse-temurin:21-jre
SAVE ARTIFACT /opt/java/openjdk openjdk
docker-build:
FROM ubuntu:22.04
ENV JAVA_HOME=/opt/java/openjdk
ARG TARGETOS
ARG TARGETARCH
ARG BUILD_TYPE
ARG APP_VERSION
ARG REGISTRY_ORG
ARG COMMIT_ID
ARG STORE_NATIVE_BRANCH="v2.0.7"
ARG YANO_TAG="v0.1.0-pre17"
ARG YANO_VERSION="0.1.0-pre17"
COPY --dir +java-setup/openjdk /opt/java/
ENV PATH="${JAVA_HOME}/bin:${PATH}"
COPY docker/install-packages.sh .
RUN chmod -R 755 install-packages.sh
RUN ./install-packages.sh
RUN groupadd -r app && useradd --no-log-init -r -g app app
RUN mkdir "/app"
RUN chown app:app /app
#Commented for now
#USER app
WORKDIR /app
COPY docker/download-$TARGETARCH.sh .
RUN sh download-$TARGETARCH.sh
#Ogmios download
COPY docker/download-ogmios.sh .
RUN bash download-ogmios.sh $TARGETARCH
#Kupo download
COPY docker/download-kupo.sh .
RUN bash download-kupo.sh $TARGETARCH
#RUN apk --no-cache add curl
RUN echo "I'm building for $TARGETOS/$TARGETARCH"
RUN mkdir -p /app/store/config
RUN echo ${APP_VERSION} > /app/version
# Yaci Store native variants (always included). The Store config is generated at
# runtime by the CLI (YaciStoreConfigBuilder), so no static config is bundled.
# yaci-store-n2c -> haskell-only / companion / yano-primary (N2C local-state-query)
# yaci-store-all -> yano-only (no N2C; derives protocol params from epoch_param)
COPY (../store-build/+store-native/yaci-store* --APP_VERSION=${APP_VERSION} --STORE_BRANCH=${STORE_NATIVE_BRANCH}) /app/store/
RUN chmod +x /app/store/yaci-store-n2c /app/store/yaci-store-all
# Yano native binary (always included; Yano is native-only in docker).
# Docker intentionally uses the published Yano release artifact instead of
# ../yano-build so the image gets the same portable binary tested upstream.
COPY docker/download-yano.sh .
RUN bash download-yano.sh $TARGETARCH ${YANO_VERSION} ${YANO_TAG}
RUN echo "Build type: $BUILD_TYPE"
IF [ "$BUILD_TYPE" = "native" ]
COPY (+cli-native/yaci-cli* --APP_VERSION=${APP_VERSION}) /app/
ELSE IF [ "$BUILD_TYPE" = "native-ci" ]
COPY (+cli-native-ci/yaci-cli* --APP_VERSION=${APP_VERSION}) /app/
ELSE
COPY (+cli-java/yaci-cli.jar --APP_VERSION=${APP_VERSION}) /app/yaci-cli.jar
END
COPY docker/yaci-cli.sh /app/
RUN chmod +x /app/yaci-cli.sh
RUN mkdir -p /app/config
COPY docker/application.properties /app/config/
COPY config/plutus-costmodels-v10.json /app/config/
COPY config/plutus-costmodels-v11.json /app/config/
ENV PATH="$PATH:/app/cardano-bin"
ENV CARDANO_NODE_SOCKET_PATH=/clusters/nodes/default/node/node.sock
ENV PROTOCOL_MAGIC=42
WORKDIR /app
EXPOSE 3001
EXPOSE 8090
EXPOSE 10000
EXPOSE 8080
EXPOSE 1337
EXPOSE 1442
EXPOSE 6060
EXPOSE 14447
ENTRYPOINT ["sh", "/app/yaci-cli.sh"]
SAVE IMAGE --push ${REGISTRY_ORG}/yaci-cli:${APP_VERSION}