I create yml to deploy to Cloud Run
- name: Build Docker image
run: |
docker build -t ${{ env.SERVICE }} .
docker tag ${{ env.SERVICE }} gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}
- name: Authenticate Docker with GCR
run: |
gcloud auth configure-docker
- name: Push Docker image to Container Registry
run: |
docker push gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}
- name: Deploy to Cloud Run
run: |
gcloud run deploy ${{ env.SERVICE }} \
--image gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }} \
--region ${{ env.REGION }} \
--port=8080
I have already check about all permission on my service account but I still got this in Cloud Run log.
Default STARTUP TCP probe failed 1 time consecutively for container "placeholder-1" on port 8080. The instance was not started.
Here is my Docker file
FROM golang:1.20-alpine
RUN mkdir app
ADD . /app/
WORKDIR /app
RUN go mod tidy && go mod vendor
ENV ENVIRONMENT RELEASE
ENV PORT 8080
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/my-project /app/src/
COPY . .
EXPOSE 8080
CMD ["./my-project"]
I try to change port but not still work.
You can get more info at
https://console.cloud.google.com/ > cloud build > select your region, then look at the build log