Skip to content

Commit a151bea

Browse files
committed
Fix apt source download logic
Signed-off-by: Patrick Foley <psfoley@gmail.com>
1 parent a785f47 commit a151bea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

openfl-docker/Dockerfile.base

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ FROM ubuntu:22.04 AS base
99
ENV DEBIAN_FRONTEND=noninteractive
1010
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1111

12+
#Establish base packages before installing anything else
13+
WORKDIR /repo
14+
COPY . .
15+
RUN mkdir -p thirdparty && \
16+
dpkg --get-selections | grep -v deinstall | awk '{print $1}' > thirdparty/base_packages.txt
17+
1218
# Install dependencies.
1319
RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
1420
apt-get update && \
@@ -43,8 +49,6 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
4349
rm -rf /var/lib/apt/lists/*
4450

4551
# Install OpenFL.
46-
WORKDIR /repo
47-
COPY . .
4852
RUN pip install --no-cache-dir . && \
4953
INSTALL_SOURCES=yes /opt/venv/lib/python3.10/site-packages/openfl-docker/licenses.sh
5054

openfl-docker/licenses.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22
# Downloads thirdparty licenses.
3-
# Save the list of installed packages to base_packages.txt
4-
dpkg --get-selections | grep -v deinstall | awk '{print $1}' > base_packages.txt
3+
cd thirdparty
54

65
# If INSTALL_SOURCES is set to "yes", perform additional operations
76
if [ "$INSTALL_SOURCES" = "yes" ]; then
@@ -26,15 +25,12 @@ if [ "$INSTALL_SOURCES" = "yes" ]; then
2625
done
2726

2827
# Clean up
29-
rm -rf ./*packages.txt
3028
echo "Download source for $(find . | wc -l) third-party packages: $(du -sh)"
3129

3230
# Clean up APT lists again
3331
rm -rf /var/lib/apt/lists/*
3432
fi
3533

36-
mkdir -p thirdparty
37-
cd thirdparty
3834

3935
# If INSTALL_SOURCES is set to "yes", perform additional operations
4036
if [ "$INSTALL_SOURCES" = "yes" ]; then

0 commit comments

Comments
 (0)