-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the binary in the deployment container
This allows us to the whole build as a single step on DockerHub
- Loading branch information
1 parent
f11237b
commit 7501e90
Showing
3 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
set -e | ||
set -x | ||
|
||
# Install the system packages needed for building the PyInstaller based binary | ||
apk -U add --virtual temp python-dev py-pip alpine-sdk python py-setuptools | ||
|
||
# Install python dependencies | ||
pip install -r https://raw.githubusercontent.com/projectcalico/libcalico/master/build-requirements.txt | ||
pip install git+https://github.com/projectcalico/libcalico.git | ||
|
||
# Produce a binary - outputs to /dist/policy_agent | ||
pyinstaller /code/policy_agent.py -ayF | ||
|
||
# Cleanup everything that was installed now that we have a self contained binary | ||
apk del temp && rm -rf /var/cache/apk/* | ||
rm -rf /usr/lib/python2.7 |