Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

GCP App Engine, Docker for windows, asp.net core and Cloudstore NoSQL

  • 18-06-2019 2:16pm
    #1
    Registered Users, Registered Users 2 Posts: 788 ✭✭✭


    I have an app engine instance running on GCP and a sample app which I can run directly from Visual studio (Windows) and I can update the cloudstore db. I can also deploy the app to GCP.

    I need an authentication key to access the service account in GCP from docker, so I've added it to the project in SweepstakesLinux/Keys so the so it gets copied to docker by the dockerfile.

    However when I try to run it in Docker, I get this error
    : 'Error reading credential file from location /app/SweepstakesLinux/Keys/KEY_NAME.json: Could not find file '/app/SweepstakesLinux/Keys/KEY_NAME.json'.
    

    My Dockerfile looks like this
    FROM gcr.io/google-appengine/aspnetcore:2.1
    COPY . /app
    WORKDIR /app
    
    # Environment Variables
    ENV GOOGLE_APPLICATION_CREDENTIALS /app/SweepstakesLinux/Keys/KEY_NAME.json
    
    
    ENTRYPOINT ["dotnet", "SweepstakesLinux.dll"]
    

    I can connect to the docker image using
    docker run -it --entrypoint sh sweepstakeslinux:dev
    
    and I can see the file exists in the directory.

    483023.png

    If I run $GOOGLE_APPLICATION_CREDENTIALS from the docker container, it seems to find the file, but not the fields in it
    483024.png

    and if I run grep vi $GOOGLE_APPLICATION_CREDENTIALS it can open the file but some of the key value pairs seem to be missing:
    483025.png

    I've also tried mounting a local folder from my PC to access and copy the key from there by running
    docker run -v C:\Users\Phil\Keys:/keys --entrypoint sh sweepstakeslinux:dev
    

    but it just results in this error:
    No executable found matching command "dotnet-SweepstakesLinux.dll"

    Any ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 788 ✭✭✭pillphil


    Changing the docker file to this works, but Im not sure if it's correct.
    	FROM gcr.io/google-appengine/aspnetcore:2.1
    	COPY . /app
    	WORKDIR /app
    	RUN mkdir /tmp/keys
    
    	RUN cp /app/SweepstakesLinux/Keys/dbAccessKey.json /tmp/keys/dbAccessKey.json
    
    	ENV GOOGLE_APPLICATION_CREDENTIALS  /tmp/keys/dbAccessKey.json
    
    
    	ENTRYPOINT ["dotnet", "SweepstakesLinux.dll"]
    
    


Advertisement