-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to install this tool globally (outside the function dir)? #50
Labels
enhancement
New feature or request
Comments
For anyone interested the following works:
|
Thank's! I'll give it a try |
Can you explain why are you installing in the /tmp folder ? |
I had a bit of trouble getting my setup working - just sharing a more recent / complete example in case it can be helpful to anybody:
# Define custom function directory
ARG FUNCTION_DIR="/function"
ARG IMAGE_TAG="3.16.5"
FROM alpine:${IMAGE_TAG} as build-step
# Set working directory to function root directory
ARG FUNCTION_DIR
WORKDIR ${FUNCTION_DIR}
# Install dependencies
RUN apk --upgrade --no-cache add \
--virtual build-deps \
g++ \
make \
cmake \
unzip \
curl-dev \
automake \
autoconf \
tar \
gzip \
libtool \
libexecinfo-dev \
python3 \
&& apk --no-cache add nodejs npm \
&& npm install -g aws-lambda-ric \
# Clean unused artifacts to reduce image size
&& apk del build-deps \
&& rm -rf \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/autom4te.cache \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/config.log \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/configure \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/docs \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/projects \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*/tests \
/usr/local/lib/node_modules/aws-lambda-ric/deps/curl-*.tar.gz
COPY app.js package.json ${FUNCTION_DIR}
RUN npm install
ENTRYPOINT ["/usr/bin/npx", "aws-lambda-ric"]
CMD [ "app.handler" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In an attempt to reduce the time it takes to re-package, I'm looking at installing this tool globally (
npm install -g aws-lambda-ric
) before my function code it copied into the image to take advantage of dockers caching/layering.The suggested solution (below) has no way of taking advantage of dockers layering. As we have to endure constant cURL rebuilds...
It would be great to install it globally in its own step. Docker could then cache the cURL build and developers could spend their time doing something productive...
However this results in errors from the preinstall scripts:
The text was updated successfully, but these errors were encountered: