Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google cloud SDK installation #363

Open
chintsan opened this issue Feb 18, 2023 · 1 comment
Open

Google cloud SDK installation #363

chintsan opened this issue Feb 18, 2023 · 1 comment

Comments

@chintsan
Copy link

chintsan commented Feb 18, 2023

Hi,

I am trying to set up docker container to run application in local dev environment.

Packages are hosted on GC and need to authenticate user before fetching those packages as part of install. please refer below docker file where in command to install gcloud sdk is included and it gets installed.

Temporarily trying to authenticate manually from container's CLI by running gcloud auth login etc commands, but getting "gcloud : not found"

Also tried binding / mounting google application credentials from local to container but no luck.

i'd appreciate if you can let know how to proceed on this.

`FROM node:16.13.0-alpine3.11 AS development
WORKDIR /app

setting up env etc scripts

COPY scripts /app/scripts
COPY config /app/config
COPY package.json .
COPY .nvmrc .

reading registry using .npmrc

COPY .npmrc .

RUN yarn config set registry https://registry.npmjs.org/ && npm config set registry https://registry.npmjs.org/

google cloud credentials. tokens etc. trying this temporarily till the time GC sdk works out.

COPY application_default_credentials.json .

COPY yarn.lock .
COPY server/public public
COPY .env.example /app/.env.example
COPY .env /app/.env

RUN apk update and ask add
RUN apk add \curl
RUN apk add bash

ENV NVM_DIR /app

install nvm and ensure application requirement is met by running it on lts/gallium

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install lts/gallium"

RUN apk add --no-cache python3

Google SDK installs successfully while building image but

gcloud is not available in containers terminal hence cant do manual authentication. due to this cant proceed to fetch the packages.

RUN curl -sSL https://sdk.cloud.google.com | bash

RUN yarn install

ENV PORT_NUMBER 3000
ENV GOOGLE_APPLICATION_CREDENTIALS ./application_default_credentials.json

CMD export GOOGLE_APPLICATION_CREDENTIALS

EXPOSE 3000

CMD ["npm", "start"]`

@chintsan
Copy link
Author

chintsan commented Feb 20, 2023

please can some assist this ? or let know if i need to post on other branch / repository ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant