ARG BASE_TAG

FROM node:${BASE_TAG}

WORKDIR /root

# Install the file command
RUN apt-get update && \
    apt-get install -y file && \
    rm -rf /var/lib/apt/lists/*

# Check the path to the node executable
RUN which node

# Use the file command to inspect the npm binary
RUN file $(which node)

# Use ldd to inspect the node binary
# 139 errors: 
# https://github.com/multiarch/qemu-user-static/issues/172
# https://gitlab.com/qemu-project/qemu/-/issues/1763
RUN ldd $(which node) || echo $?

# Print the version of node
RUN node -v

# Print the version of npm (this hangs on s390x)
RUN NODE_DEBUG=* node $(which npm) -v

