Skip to content

Commit eccdb32

Browse files
author
Claudio Raimondi
committed
Fix postgres library inclusion [skip ci]
1 parent 3e952b8 commit eccdb32

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ARG LD=${target_host}-ld
153153
ARG STRIP=${target_host}-strip
154154
ARG QEMU_LD_PREFIX=/usr/${target_host}
155155
ARG TARGET=${target_host_rust}
156-
ARG PKG_CONFIG_PATH=/usr/${target_host}/lib/pkgconfig
156+
ARG PKG_CONFIG_PATH=${QEMU_LD_PREFIX}/lib/pkgconfig
157157

158158
WORKDIR /opt
159159

@@ -181,14 +181,16 @@ RUN make install
181181
WORKDIR /opt/postgres
182182

183183
RUN tar xzf ${POSTGRES_TARBALL} --strip-components=1
184-
RUN ./configure --prefix=${QEMU_LD_PREFIX} --without-readline
184+
RUN ./configure --host=${target_host} --prefix=${QEMU_LD_PREFIX} --without-readline
185185
RUN make install -C src/include
186186
RUN make install -C src/interfaces/libpq
187-
RUN make install -C src/bin/pg_config
187+
188+
RUN mkdir -p /tmp/postgres_install/lib && \
189+
cp -a ${QEMU_LD_PREFIX}/lib/libpq.* /tmp/postgres_install/lib/
188190

189191
WORKDIR /opt/lightningd
190192

191-
RUN mkdir -p .cargo && tee .cargo/config <<-EOF
193+
RUN mkdir -p .cargo && tee .cargo/config.toml <<-EOF
192194
[target.${target_host_rust}]
193195
linker = "${target_host}-gcc"
194196
EOF
@@ -203,7 +205,6 @@ FROM ${BASE_DISTRO} AS final
203205

204206
RUN apt-get update -qq && \
205207
apt-get install -qq -y --no-install-recommends \
206-
libpq5 \
207208
inotify-tools \
208209
socat \
209210
jq && \
@@ -215,17 +216,19 @@ ENV LIGHTNINGD_RPC_PORT=9835
215216
ENV LIGHTNINGD_PORT=9735
216217
ENV LIGHTNINGD_NETWORK=bitcoin
217218

218-
COPY --from=builder /tmp/lightning_install/ /usr/local/
219-
COPY --from=downloader /opt/bitcoin/bin /usr/bin
220-
COPY --from=downloader /opt/litecoin/bin /usr/bin
221-
COPY tools/docker-entrypoint.sh /entrypoint.sh
219+
COPY --from=downloader /opt/bitcoin/bin/ /usr/bin/
220+
COPY --from=downloader /opt/litecoin/bin/ /usr/bin/
221+
COPY --from=builder /tmp/lightning_install/ /usr/local/
222+
COPY --from=builder /tmp/postgres_install/lib/ /usr/lib/
222223

223-
RUN for f in /usr/local/bin/* /usr/bin/*; do \
224+
RUN for f in /usr/bin/*; do \
224225
if file "$f" | grep -q ELF; then \
225226
strip --strip-unneeded "$f"; \
226227
fi; \
227228
done
228229

230+
COPY tools/docker-entrypoint.sh /entrypoint.sh
231+
229232
#TODO: user creation. user permissions on volume.
230233

231234
EXPOSE 9735 9835

0 commit comments

Comments
 (0)