Add node package to server side tag manager image

Hi everyone, we are currently setting up the server-side tag manager for a client and want to stream the data to an S3 bucket using AWS Firehose. Since I need the corresponding nodeJs packages for this, I have the question of how I can add these to the server / image hosted in gcr?. Has anyone done this before and can support me here? With my attempts so far I always get a bash error: #0 0.267 runc run failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory

Here is my minimal Dockerfile.

 

 

# ---- Base Node ----
FROM gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable

# define variables
ARG NODE_VERSION=16.13.0
ARG CLIENT_COGNITO_IDENTITY_VERSION="^3.335.0"
ARG CREDENTIAL_PROVIDER_COGNITO_IDENTITY_VERSION="^3.335.0"
ARG TYPES_VERSION="^3.342.0"
ARG CLIENT_FIREHOSE_VERSION="^3.337.0"

# Set the working directory
WORKDIR /app

# ---- Dependencies ----
# install node packages
# RUN npm set progress=false
# RUN npm config set depth 0
# RUN npm install aws-sdk/client-cognito-identity@${CLIENT_COGNITO_IDENTITY_VERSION}
# RUN npm install aws-sdk/credential-provider-cognito-identity@${CREDENTIAL_PROVIDER_COGNITO_IDENTITY_VERSION}
# RUN npm install aws-sdk/types@${TYPES_VERSION}
# RUN npm install aws-sdk/client-firehose@${CLIENT_FIREHOSE_VERSION}

 

 



Thank you very much in advance.
Dennis

0 1 689
1 REPLY 1

Hi @kurtmcfuhrt,

Welcome to the Google Cloud Community!

You can try the following troubleshooting options:

  1. It seems that the lines that are responsible for installing the packages are currently commented out. You can undo this by removing the "#" symbol.
    RUN npm set progress=false
    RUN npm config set depth 0
    RUN npm install aws-sdk/client-cognito-identity@${CLIENT_COGNITO_IDENTITY_VERSION}
    RUN npm install aws-sdk/credential-provider-cognito-identity@${CREDENTIAL_PROVIDER_COGNITO_IDENTITY_VERSION}
    RUN npm install aws-sdk/types@${TYPES_VERSION}
    RUN npm install aws-sdk/client-firehose@${CLIENT_FIREHOSE_VERSION}
  2. The /bin/sh directory may not be found because the container that you are accessing with gcr is Container Registry, which is now deprecated. Read more in this documentation.
  3. You can also get in touch with Google Cloud Support if the above options don't work.

Let me know if it helped, thanks!