rhymbit
rhymbit
DDeno
Created by rhymbit on 7/31/2024 in #help
Google Cloud Storage library error inside docker, but outside on my pc it's working fine.
The library in question is this :- "@google-cloud/storage": "npm:@google-cloud/storage@^7.11.2", Inside the code, the library simply download a json file from google storage. When I run code outside the docker container locally, it works fine and is able to download the file. The dockerfile I'm currently using is this :-
FROM node:slim
# Install Deno
COPY --from=denoland/deno:latest /deno /usr/local/bin/deno
EXPOSE 8000
WORKDIR /app
ADD . /app
# set DENO_DIR to avoid conflicts with google cloud
ENV DENO_DIR=./.deno_cache
RUN deno cache src/main.ts

CMD ["deno", "serve", "-A", "src/main.ts", "--env_type=production"]
FROM node:slim
# Install Deno
COPY --from=denoland/deno:latest /deno /usr/local/bin/deno
EXPOSE 8000
WORKDIR /app
ADD . /app
# set DENO_DIR to avoid conflicts with google cloud
ENV DENO_DIR=./.deno_cache
RUN deno cache src/main.ts

CMD ["deno", "serve", "-A", "src/main.ts", "--env_type=production"]
I've already tried using deno's official image FROM denoland/deno:latest and install nodejs inside it, but it throws the same error.
6 replies