Compare commits

..

No commits in common. "52eb0542770c4ab8e22bb62e90476446e98ec958" and "febb6e955c50631d8f7a5d56d4ab62b2e59e2777" have entirely different histories.

3 changed files with 11 additions and 35 deletions

1
.gitignore vendored
View File

@ -139,4 +139,3 @@ cython_debug/
.container*
.dockerfile*
include/
lambda.zip

View File

@ -39,21 +39,14 @@ COPY etags.py /src/
WORKDIR /src
# We use find here because different architectures might be wildly different.
# The specific directory is named by the gcc toolchain, which doesn't really
# line up here with uname -m. As an example, 32 bit arm libraries can be the
# same across arm versions (arm7/arm8 32 bit)
# x86_64: /lib/x86_64-linux-gnu
# arm64: /lib/aarch64-linux-gnu
# arm7: /lib/arm-linux-gnueabihf
RUN true \
&& pip3 install -r requirements.txt \
&& pyinstaller -F etags.py \
&& staticx \
--strip \
--no-compress \
-l "$(find /lib -name libgcc_s.so.1 -print -quit)" \
dist/etags dist/app \
RUN true \
&& pip3 install -r requirements.txt \
&& pyinstaller -F etags.py \
&& staticx \
--strip \
--no-compress \
-l $(find /lib -name libgcc_s.so.1) \
dist/etags dist/app \
&& chmod 755 dist/app
FROM scratch

View File

@ -91,25 +91,9 @@ container containers: $(CONTAINER_DOTFILES)
echo "container: $(REGISTRY)/$$bin:$(TAG)"; \
done
lambda-package: # @HELP creates a lambda package zipfile "lambda.zip" suitable for uploading
lambda-package: lambda.zip # Python - mostly not compiled, and deps that are, are linux/amd64
SOURCES = $(foreach bin,$(BINS),$(bin).py)
lambda.zip: requirements.txt $(SOURCES)
@cid=$$($(DKR) create amazonlinux:2 /bin/sh -c ' \
amazon-linux-extras enable python3.8; \
yum install -y python38 zip; \
alternatives --install /usr/bin/python python /usr/bin/python3.8 1; \
alternatives --install /usr/bin/pip pip /usr/bin/pip3.8 1; \
cd /src && pip install --target ./package -r requirements.txt; \
rm lambda.zip 2>/dev/null; \
zip -r -9 lambda.zip ./package; \
zip -g lambda.zip *.py; \
'); \
$(DKR) cp . $$cid:/src/; \
$(DKR) start -a $$cid; \
$(DKR) cp $$cid:/src/lambda.zip .; \
$(DKR) rm $$cid
lambda-layer: # @HELP creates a lambda layer zipfile "lambda.zip" suitable for uploading
lambda-layer: # Python - mostly not compiled, and deps that are, are linux/amd64
@echo "todo"
# Each container-dotfile target can reference a $(BIN) variable.
# This is done in 2 steps to enable target-specific variables.