From d18b939a2574103d252fbc588500b4f2fbbd2cc2 Mon Sep 17 00:00:00 2001 From: Gonzalo Avalos Ribas Date: Mon, 8 Apr 2024 12:44:43 -0300 Subject: [PATCH] Change dockerfile to make compatible with collectors --- Dockerfile | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index d98a19f..f6b1905 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,11 @@ -FROM node:18-bullseye-slim as builder +FROM node:18-alpine ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration -COPY package.json yarn.lock tsconfig.dist.json tsconfig.json LICENSE ${JUPITERONE_INTEGRATION_DIR}/ +COPY package.json yarn.lock tsconfig.json LICENSE ${JUPITERONE_INTEGRATION_DIR}/ COPY src/ ${JUPITERONE_INTEGRATION_DIR}/src -WORKDIR ${JUPITERONE_INTEGRATION_DIR} -RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/api/lists/* -RUN yarn install -RUN yarn build:docker - -FROM node:18-bullseye-slim -ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration -COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/dist ${JUPITERONE_INTEGRATION_DIR} -COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/yarn.lock ${JUPITERONE_INTEGRATION_DIR} -COPY scripts/ ${JUPITERONE_INTEGRATION_DIR}/scripts WORKDIR ${JUPITERONE_INTEGRATION_DIR} -RUN apt-get update && apt-get install -y python3 -RUN yarn install --production --fronzen-lockfile --cache-folder ./ycache && yarn global add --cache-folder ./ycache @jupiterone/integration-sdk-cli && rm -rf ./ycache && chown -R node:node /opt/jupiterone -RUN export PATH="$(yarn global bin):$PATH" - -USER node +RUN yarn install -CMD ["sh", "scripts/execute.sh"] +ENTRYPOINT /usr/local/bin/yarn j1-integration run -i ${INTEGRATION_INSTANCE_ID} --disable-schema-validation --api-base-url ${JUPITERONE_API_BASE_URL:-https://api.us.jupiterone.io} --account ${JUPITERONE_ACCOUNT} --api-key ${JUPITERONE_API_KEY} \ No newline at end of file