Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Add pip docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed Dec 8, 2023
1 parent 02fb645 commit 11ffa7e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.iml
.idea/
.DS_Store
/docker/pip/out/
23 changes: 23 additions & 0 deletions docker/pip/amd64.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM quay.io/pypa/manylinux_2_28_x86_64

RUN yum install -y golang python3 python3-setuptools python3-wheel wget

WORKDIR /pip

ARG COMMONVERSION

RUN wget -O eduvpn-common.tar.xz https://github.com/eduvpn/eduvpn-common/releases/download/$COMMONVERSION/eduvpn-common-$COMMONVERSION.tar.xz
RUN tar xf eduvpn-common.tar.xz

WORKDIR /pip/eduvpn-common-$COMMONVERSION

RUN CGO_ENABLED=1 go build -buildvcs=false -o lib/linux/amd64/libeduvpn_common-$COMMONVERSION.so -buildmode=c-shared ./exports

WORKDIR /pip/eduvpn-common-$COMMONVERSION/wrappers/python

RUN ./setup.py bdist_wheel --exports-lib-path="../../lib"

RUN auditwheel repair dist/*

RUN mkdir /wheelhouse
RUN cp -r wheelhouse/* /wheelhouse
23 changes: 23 additions & 0 deletions docker/pip/arm64.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM quay.io/pypa/manylinux_2_28_aarch64

RUN yum install -y golang python3 python3-setuptools python3-wheel wget

WORKDIR /pip

ARG COMMONVERSION

RUN wget -O eduvpn-common.tar.xz https://github.com/eduvpn/eduvpn-common/releases/download/$COMMONVERSION/eduvpn-common-$COMMONVERSION.tar.xz
RUN tar xf eduvpn-common.tar.xz

WORKDIR /pip/eduvpn-common-$COMMONVERSION

RUN CGO_ENABLED=1 go build -buildvcs=false -o lib/linux/arm64/libeduvpn_common-$COMMONVERSION.so -buildmode=c-shared ./exports

WORKDIR /pip/eduvpn-common-$COMMONVERSION/wrappers/python

RUN ./setup.py bdist_wheel --exports-lib-path="../../lib"

RUN auditwheel repair dist/*

RUN mkdir /wheelhouse
RUN cp -r wheelhouse/* /wheelhouse
13 changes: 13 additions & 0 deletions docker/pip/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

VERSION=$(git tag | sort -V | tail -1)
mkdir -p out/"$VERSION"

# amd64
sudo docker build --build-arg COMMONVERSION="$VERSION" -f amd64.dockerfile -t common-pip-amd64 .
sudo docker run -v "$PWD"/out/"$VERSION":/io --rm -ti common-pip-amd64 bash -c "cp /wheelhouse/* /io"

# arm64
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
sudo docker build --build-arg COMMONVERSION="$VERSION" -f arm64.dockerfile -t common-pip-arm64 .
sudo docker run -v "$PWD"/out/"$VERSION":/io --rm -ti common-pip-arm64 bash -c "cp /wheelhouse/* /io"

0 comments on commit 11ffa7e

Please sign in to comment.