facd64a14b
* first pass use tests/sdk-tests/run-tests.sh in github action * - -> _ * diagnostic env step * diagnostic env step * diagnostic env step does not support cwd * checkout not preserved between actions * ./ missing * start built containers * missing unmarshalling of content bytes before encoding and generation of CID * unchecked error complaint from linter * golang linting is really picky * utils/json test for comparing known, but deprecated method to new implementation * try curl (retval 0) instead of wget (retval 8) for 404 that is returned * missing curl for health check * use feature branch for laconic-sdk... UNDO THIS LATER * checkout is done from inside of container, rather than copied in from filesystem. checking out dev branch for now * docker network inspect for diagnostic * docker network inspect for diagnostic missing arg * listen on 0.0.0.0 specfically * trying localhost * try host mode network * host mode breaks name resolution of containers * manual service check in laconicd container for diagnostic * revert ListenAndServe * sleep and docker logs... appears endpoint is not coming up maybe? * disable fail_ci on codecov error... it is unstable * turn codecov back to fail on error true to avoid invisible failure. * Cleanup for whitespace and require.NoError in test * new json util test, turning off codecov fails CI, and gitignore for test artifacts
54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
|
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
|
ARG VARIANT=16-bullseye
|
|
FROM node:${VARIANT}
|
|
|
|
ARG USERNAME=node
|
|
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
|
|
|
# Add NPM global to PATH.
|
|
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
|
|
|
RUN \
|
|
# Configure global npm install location, use group to adapt to UID/GID changes
|
|
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
|
|
&& usermod -a -G npm ${USERNAME} \
|
|
&& umask 0002 \
|
|
&& mkdir -p ${NPM_GLOBAL} \
|
|
&& touch /usr/local/etc/npmrc \
|
|
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
|
|
&& chmod g+s ${NPM_GLOBAL} \
|
|
&& npm config -g set prefix ${NPM_GLOBAL} \
|
|
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
|
|
# Install eslint
|
|
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
|
|
&& npm cache clean --force > /dev/null 2>&1
|
|
|
|
# [Optional] Uncomment this section to install additional OS packages.
|
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
|
|
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
|
# ARG EXTRA_NODE_VERSION=10
|
|
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
|
|
|
# [Optional] Uncomment if you want to install more global node modules
|
|
# RUN su node -c "npm install -g <your-package-list-here>"
|
|
|
|
WORKDIR /
|
|
COPY entrypoint.sh .
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
# Placeholder CMD : generally this will be overridden at run time like :
|
|
# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
|
|
CMD node --version
|
|
|
|
# Temp hack, clone the laconic-sdk repo here
|
|
WORKDIR /app
|
|
RUN \
|
|
git clone https://github.com/cerc-io/laconic-sdk.git \
|
|
&& cd laconic-sdk \
|
|
&& git checkout jest_timeout \
|
|
&& yarn install
|
|
|
|
WORKDIR /app/laconic-sdk
|