Skip to content

Commit

Permalink
TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed Sep 30, 2024
1 parent 6a9a6f7 commit d94882f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,39 @@ RUN apt-get update && \
dumb-init \
g++ \
gcc \
libldap2-dev \
# libldap2-dev \
libpq-dev \
libsasl2-dev \
# libsasl2-dev \
patchelf \
pipx \
python3-dev \
wget \
&& \
pipx install hatch
pipx install auditwheel && \
pipx install hatch;

## Copy project files needed by hatch
COPY README.md pyproject.toml ./
COPY guacamole_user_sync guacamole_user_sync
COPY guacamole_user_sync/*.py guacamole_user_sync/

## Build wheels for dependencies then use auditwheel to include shared libraries
## Note that we need to specify psycopg[c] in order to ensure that dependencies are included in the wheel
RUN /root/.local/bin/hatch run pip freeze | grep -v "^-e" > requirements.txt && \
sed -i "s/psycopg=/psycopg[c]=/g" requirements.txt && \
python -m pip wheel --no-cache-dir --no-binary :all: --wheel-dir /app/repairable -r requirements.txt && \
python -m pip install auditwheel && \
mkdir -p /app/wheels && \
python -m pip wheel --no-cache-dir --no-binary :all: --wheel-dir /app/repairable -r requirements.txt && \
for WHEEL in /app/repairable/*.whl; do \
auditwheel repair --wheel-dir /app/wheels --plat manylinux_2_34_aarch64 "${WHEEL}" 2> /dev/null || mv "${WHEEL}" /app/wheels/; \
done;
/root/.local/bin/auditwheel repair --wheel-dir /app/wheels --plat manylinux_2_34_aarch64 "${WHEEL}" 2> /dev/null || mv "${WHEEL}" /app/wheels/; \
done && \
rm -rf /app/repairable && \
ls -alh /app/wheels/;

## Build a separate pip wheel which can be used to install itself
RUN python -m pip wheel --no-cache-dir --wheel-dir /app/wheels pip && \
mv /app/wheels/pip*whl /app/wheels/pip-0-py3-none-any.whl

## Build a separate wheel for the project
COPY guacamole_user_sync guacamole_user_sync
RUN /root/.local/bin/hatch build -t wheel && \
mv dist/guacamole_user_sync*.whl /app/wheels/ && \
echo "guacamole-user-sync>=0.0" >> requirements.txt
Expand Down

0 comments on commit d94882f

Please sign in to comment.