Skip to content
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

Support adding apk repositories #169

Open
maiermic opened this issue Aug 10, 2019 · 0 comments
Open

Support adding apk repositories #169

maiermic opened this issue Aug 10, 2019 · 0 comments

Comments

@maiermic
Copy link

Thanks to #28 it is possible to install additional packages using --build-arg ADDITIONAL_PACKAGE=<package-names>. However, you can only install packages from the default repositories defined in /etc/apk/repositories.

Possible Solution

Add another build argument ADDITIONAL_REPOSITORY, whose content is appended to /etc/apk/repositories and update the package list. This might be accomplished by modifying an existing installation statement in the Dockerfile

RUN apk --no-cache add ca-certificates ${ADDITIONAL_PACKAGE}

to

ARG ADDITIONAL_REPOSITORY
RUN printf ${ADDITIONAL_REPOSITORY} >> /etc/apk/repositories && \
  apk --update --no-cache add ca-certificates ${ADDITIONAL_PACKAGE}

Thereby, you can build it using two additional repositories

faas-cli build \
  --build-arg ADDITIONAL_REPOSITORY="http://dl-cdn.alpinelinux.org/alpine/edge/main\nhttp://dl-cdn.alpinelinux.org/alpine/edge/community" \
  --build-arg ADDITIONAL_PACKAGE=<package-name> \
  -f <yml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant