Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Dockerfile: added alpine builders
- Loading branch information
Showing
8 changed files
with
126 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Usage: | ||
# | ||
# docker build -t bcryptjs-linux-alpine-builder -f Dockerfile-alpine . | ||
# CONTAINER=$(docker create bcryptjs-linux-alpine-builder) | ||
# # Then copy the artifact to your host: | ||
# docker cp "$CONTAINER:/usr/local/opt/bcrypt-js/prebuilds" . | ||
# docker rm "$CONTAINER" | ||
|
||
FROM node:16-alpine | ||
|
||
ENV project bcrypt-js | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG ${LC_ALL} | ||
|
||
RUN echo "#log: ${project}: Setup system" \ | ||
&& set -x \ | ||
&& apk add --update build-base python3 \ | ||
&& npm i -g prebuildify@5 node-gyp@9 \ | ||
&& sync | ||
|
||
ADD . /usr/local/opt/${project} | ||
WORKDIR /usr/local/opt/${project} | ||
|
||
RUN echo "#log: ${project}: Running build" \ | ||
&& set -x \ | ||
&& npm ci \ | ||
&& npm run build | ||
|
||
ARG RUN_TESTS=true | ||
|
||
RUN if "${RUN_TESTS}"; then \ | ||
echo "#log ${project}: Running tests" \ | ||
&& npm test; \ | ||
else \ | ||
echo "#log ${project}: Tests were skipped!"; \ | ||
fi | ||
|
||
CMD /bin/bash -l |
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,39 @@ | ||
# Usage: | ||
# | ||
# docker build -t bcryptjs-alpine-arm-builder -f Dockerfile-arm . | ||
# CONTAINER=$(docker create bcryptjs-alpine-arm-builder) | ||
# # Then copy the artifact to your host: | ||
# docker cp "$CONTAINER:/usr/local/opt/bcrypt-js/prebuilds" . | ||
# docker rm "$CONTAINER" | ||
|
||
FROM arm32v7/node:16-alpine | ||
|
||
ENV project bcrypt-js | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG ${LC_ALL} | ||
|
||
RUN echo "#log: ${project}: Setup system" \ | ||
&& set -x \ | ||
&& apk add --update build-base python3 \ | ||
&& npm i -g prebuildify@5 node-gyp@9 \ | ||
&& sync | ||
|
||
ADD . /usr/local/opt/${project} | ||
WORKDIR /usr/local/opt/${project} | ||
|
||
RUN echo "#log: ${project}: Running build" \ | ||
&& set -x \ | ||
&& npm ci \ | ||
&& npm run build | ||
|
||
ARG RUN_TESTS=true | ||
|
||
RUN if "${RUN_TESTS}"; then \ | ||
echo "#log ${project}: Running tests" \ | ||
&& npm test; \ | ||
else \ | ||
echo "#log ${project}: Tests were skipped!"; \ | ||
fi | ||
|
||
CMD /bin/bash -l |
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,39 @@ | ||
# Usage: | ||
# | ||
# docker build -t bcryptjs-alpine-arm-builder -f Dockerfile-arm . | ||
# CONTAINER=$(docker create bcryptjs-alpine-arm-builder) | ||
# # Then copy the artifact to your host: | ||
# docker cp "$CONTAINER:/usr/local/opt/bcrypt-js/prebuilds" . | ||
# docker rm "$CONTAINER" | ||
|
||
FROM arm64v8/node:16-alpine | ||
|
||
ENV project bcrypt-js | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG ${LC_ALL} | ||
|
||
RUN echo "#log: ${project}: Setup system" \ | ||
&& set -x \ | ||
&& apk add --update build-base python3 \ | ||
&& npm i -g prebuildify@5 node-gyp@9 \ | ||
&& sync | ||
|
||
ADD . /usr/local/opt/${project} | ||
WORKDIR /usr/local/opt/${project} | ||
|
||
RUN echo "#log: ${project}: Running build" \ | ||
&& set -x \ | ||
&& npm ci \ | ||
&& npm run build | ||
|
||
ARG RUN_TESTS=true | ||
|
||
RUN if "${RUN_TESTS}"; then \ | ||
echo "#log ${project}: Running tests" \ | ||
&& npm test; \ | ||
else \ | ||
echo "#log ${project}: Tests were skipped!"; \ | ||
fi | ||
|
||
CMD /bin/bash -l |
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
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