Compare commits
2 Commits
febb6e955c
...
52eb054277
Author | SHA1 | Date | |
---|---|---|---|
52eb054277 | |||
a669d9adac |
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -139,3 +139,4 @@ cython_debug/
|
|||
.container*
|
||||
.dockerfile*
|
||||
include/
|
||||
lambda.zip
|
||||
|
|
23
Dockerfile
23
Dockerfile
|
@ -39,14 +39,21 @@ COPY etags.py /src/
|
|||
|
||||
WORKDIR /src
|
||||
|
||||
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 \
|
||||
# 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 \
|
||||
&& chmod 755 dist/app
|
||||
|
||||
FROM scratch
|
||||
|
|
22
Makefile
22
Makefile
|
@ -91,9 +91,25 @@ container containers: $(CONTAINER_DOTFILES)
|
|||
echo "container: $(REGISTRY)/$$bin:$(TAG)"; \
|
||||
done
|
||||
|
||||
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"
|
||||
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
|
||||
|
||||
# Each container-dotfile target can reference a $(BIN) variable.
|
||||
# This is done in 2 steps to enable target-specific variables.
|
||||
|
|
Loading…
Reference in New Issue
Block a user