Google cloud SDK installation

Open
#363 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, google-cloud, javascript, node.js
Domain
cloud, devops

Research direction

Start with the Dockerfile shown in the issue and reproduce the image build and container shell steps around the Google Cloud SDK installation. Investigate why the installed gcloud command is unavailable and verify that authentication and package installation complete successfully in the container.

Written by the indexing model from the issue text.

Description

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"]`

Dominant language
JavaScript
Stars
3.1k
Forks
6.4k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/getting-started

All issues in docker/getting-started

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.