Skip to content

Commit 5ed9e54

Browse files
author
Claudio Raimondi
committed
Add TODOs [skip ci]
1 parent ae60571 commit 5ed9e54

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

Dockerfile

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ RUN apt-get update -qq && \
6767
wget \
6868
python3 \
6969
python3-dev \
70+
python3-venv \
7071
autoconf \
7172
automake \
7273
libicu-dev \
@@ -120,11 +121,14 @@ ADD ${POSTGRES_URL}/v${POSTGRES_VERSION}/${POSTGRES_TARBALL}.sha256 .
120121

121122
RUN sha256sum -c ${POSTGRES_TARBALL}.sha256
122123

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
125128

126129
WORKDIR /opt/lightningd
127130

131+
#TODO: fix docker caching at this stage.
128132
COPY . .
129133

130134
RUN git submodule update --init --recursive
@@ -155,6 +159,16 @@ FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
155159
ENV RUST_PROFILE=release
156160
ENV LIGHTNINGD_VERSION=master
157161

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+
158172
ARG AR=${target_host}-ar
159173
ARG AS=${target_host}-as
160174
ARG CC=${target_host}-gcc
@@ -170,35 +184,28 @@ RUN apt-get install -qq -y --no-install-recommends \
170184
gcc-${target_host_gcc} \
171185
g++-${target_host_gcc}
172186

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.
181188

182189
WORKDIR /opt/zlib
183190

184191
RUN tar xzf ${ZLIB_TARBALL} --strip-components=1
185192
RUN ./configure --prefix=${QEMU_LD_PREFIX}
186193
RUN make -j
187-
RUN make install
194+
RUN make -j install
188195

189196
WORKDIR /opt/sqlite
190197

191198
RUN tar xzf ${SQLITE_TARBALL} --strip-components=1
192199
RUN ./configure --host=${target_host} --prefix=${QEMU_LD_PREFIX} --enable-static --disable-readline --disable-threadsafe --disable-load-extension
193200
RUN make -j
194-
RUN make install
201+
RUN make -j install
195202

196203
WORKDIR /opt/postgres
197204

198205
RUN tar xzf ${POSTGRES_TARBALL} --strip-components=1
199206
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
202209

203210
RUN mkdir -p /tmp/postgres_install/lib && \
204211
cp -a ${QEMU_LD_PREFIX}/lib/libpq.* /tmp/postgres_install/lib/
@@ -210,8 +217,6 @@ RUN mkdir -p .cargo && tee .cargo/config.toml <<-EOF
210217
linker = "${target_host}-gcc"
211218
EOF
212219

213-
ARG POETRY_VIRTUALENVS_CREATE=false
214-
215220
RUN poetry lock && \
216221
poetry install --no-root --no-interaction --no-ansi
217222

0 commit comments

Comments
 (0)