@@ -120,10 +120,6 @@ COPY --from=electriccoinco/lightwalletd:latest /usr/local/bin/lightwalletd /usr/
120
120
# and allow to change permissions for mounted cache directories
121
121
COPY --from=tianon/gosu:bookworm /gosu /usr/local/bin/
122
122
123
- # Use the same default config as in the production environment.
124
- ENV ZEBRA_CONF_PATH="${HOME}/.config/zebrad.toml"
125
- COPY --chown=${UID}:${GID} ./docker/default-zebra-config.toml ${ZEBRA_CONF_PATH}
126
-
127
123
# As the build has already run with the root user,
128
124
# we need to set the correct permissions for the home and cargo home dirs owned by it.
129
125
RUN chown -R ${UID}:${GID} "${HOME}" && \
@@ -140,7 +136,9 @@ ENTRYPOINT [ "entrypoint.sh", "test" ]
140
136
# `test` stage. The resulting zebrad binary is used in the `runtime` stage.
141
137
FROM deps AS release
142
138
139
+ # Set the working directory for the build.
143
140
ARG HOME
141
+ WORKDIR ${HOME}
144
142
145
143
RUN --mount=type=bind,source=tower-batch-control,target=tower-batch-control \
146
144
--mount=type=bind,source=tower-fallback,target=tower-fallback \
@@ -198,15 +196,8 @@ RUN addgroup --quiet --gid ${GID} ${USER} && \
198
196
adduser --quiet --gid ${GID} --uid ${UID} --home ${HOME} ${USER} --disabled-password --gecos ""
199
197
200
198
WORKDIR ${HOME}
201
-
202
- # We set the default locations of the conf and cache dirs according to the XDG
203
- # spec: https://specifications.freedesktop.org/basedir-spec/latest/
204
-
205
199
RUN chown -R ${UID}:${GID} ${HOME}
206
200
207
- ARG ZEBRA_CONF_PATH="${HOME}/.config/zebrad.toml"
208
- ENV ZEBRA_CONF_PATH=${ZEBRA_CONF_PATH}
209
-
210
201
# We're explicitly NOT using the USER directive here.
211
202
# Instead, we run as root initially and use gosu in the entrypoint.sh
212
203
# to step down to the non-privileged user. This allows us to change permissions
@@ -216,7 +207,6 @@ ENV ZEBRA_CONF_PATH=${ZEBRA_CONF_PATH}
216
207
# Copy the gosu binary to be able to run the entrypoint as non-root user
217
208
COPY --from=tianon/gosu:bookworm /gosu /usr/local/bin/
218
209
COPY --from=release /usr/local/bin/zebrad /usr/local/bin/
219
- COPY --chown=${UID}:${GID} ./docker/default-zebra-config.toml ${ZEBRA_CONF_PATH}
220
210
COPY --chown=${UID}:${GID} ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
221
211
222
212
ENTRYPOINT [ "entrypoint.sh" ]
0 commit comments