@@ -67,6 +67,7 @@ RUN apt-get update -qq && \
67
67
wget \
68
68
python3 \
69
69
python3-dev \
70
+ python3-venv \
70
71
autoconf \
71
72
automake \
72
73
libicu-dev \
@@ -120,11 +121,14 @@ ADD ${POSTGRES_URL}/v${POSTGRES_VERSION}/${POSTGRES_TARBALL}.sha256 .
120
121
121
122
RUN sha256sum -c ${POSTGRES_TARBALL}.sha256
122
123
123
- ADD --chmod=750 https://sh.rustup.rs /opt/install-rust.sh
124
- ADD --chmod=750 https://install.python-poetry.org /opt/install-poetry.py
124
+ WORKDIR /opt
125
+
126
+ ADD --chmod=750 https://install.python-poetry.org install-poetry.py
127
+ ADD --chmod=750 https://sh.rustup.rs install-rust.sh
125
128
126
129
WORKDIR /opt/lightningd
127
130
131
+ # TODO: fix docker caching at this stage.
128
132
COPY . .
129
133
130
134
RUN git submodule update --init --recursive
@@ -155,6 +159,16 @@ FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
155
159
ENV RUST_PROFILE=release
156
160
ENV LIGHTNINGD_VERSION=master
157
161
162
+ WORKDIR /opt
163
+
164
+ RUN ./install-poetry.py
165
+ RUN ./install-rust.sh -y --target ${target_host_rust} --profile minimal
166
+
167
+ ARG POETRY_VIRTUALENVS_CREATE=false
168
+ ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
169
+
170
+ RUN rustup toolchain install stable --component rustfmt --allow-downgrade
171
+
158
172
ARG AR=${target_host}-ar
159
173
ARG AS=${target_host}-as
160
174
ARG CC=${target_host}-gcc
@@ -170,35 +184,28 @@ RUN apt-get install -qq -y --no-install-recommends \
170
184
gcc-${target_host_gcc} \
171
185
g++-${target_host_gcc}
172
186
173
- WORKDIR /opt
174
-
175
- RUN ./install-rust.sh -y --target ${target_host_rust} --default-host ${target_host_rust} --profile minimal
176
- RUN ./install-poetry.py
177
-
178
- ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
179
-
180
- RUN rustup toolchain install stable --component rustfmt --allow-downgrade
187
+ # TODO: speedup, anything below this is super slow.
181
188
182
189
WORKDIR /opt/zlib
183
190
184
191
RUN tar xzf ${ZLIB_TARBALL} --strip-components=1
185
192
RUN ./configure --prefix=${QEMU_LD_PREFIX}
186
193
RUN make -j
187
- RUN make install
194
+ RUN make -j install
188
195
189
196
WORKDIR /opt/sqlite
190
197
191
198
RUN tar xzf ${SQLITE_TARBALL} --strip-components=1
192
199
RUN ./configure --host=${target_host} --prefix=${QEMU_LD_PREFIX} --enable-static --disable-readline --disable-threadsafe --disable-load-extension
193
200
RUN make -j
194
- RUN make install
201
+ RUN make -j install
195
202
196
203
WORKDIR /opt/postgres
197
204
198
205
RUN tar xzf ${POSTGRES_TARBALL} --strip-components=1
199
206
RUN ./configure --host=${target_host} --prefix=${QEMU_LD_PREFIX} --without-readline
200
- RUN make install -C src/include
201
- RUN make install -C src/interfaces/libpq
207
+ RUN make -j install -C src/include
208
+ RUN make -j install -C src/interfaces/libpq
202
209
203
210
RUN mkdir -p /tmp/postgres_install/lib && \
204
211
cp -a ${QEMU_LD_PREFIX}/lib/libpq.* /tmp/postgres_install/lib/
@@ -210,8 +217,6 @@ RUN mkdir -p .cargo && tee .cargo/config.toml <<-EOF
210
217
linker = "${target_host}-gcc"
211
218
EOF
212
219
213
- ARG POETRY_VIRTUALENVS_CREATE=false
214
-
215
220
RUN poetry lock && \
216
221
poetry install --no-root --no-interaction --no-ansi
217
222
0 commit comments