Skip to content

Instantly share code, notes, and snippets.

@jamesward
Created May 4, 2021 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesward/aa41fbdabc1b58152828018dedef9711 to your computer and use it in GitHub Desktop.
Save jamesward/aa41fbdabc1b58152828018dedef9711 to your computer and use it in GitHub Desktop.
Spring Boot Cloud Run Deploy
mkdir tmp
cd tmp
curl -sL https://start.spring.io/starter.zip -d bootVersion=2.4.5 -d dependencies=web -o demo.zip; unzip demo.zip; rm demo.zip
echo "hello, world" > src/main/resources/static/index.html
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=gcr.io/jw-demo/springboot-demo -Dspring-boot.build-image.builder=gcr.io/buildpacks/builder:v1
docker push gcr.io/jw-demo/springboot-demo
gcloud run deploy --project=jw-demo --platform=managed --region=us-central1 --image=gcr.io/jw-demo/springboot-demo --allow-unauthenticated --memory=1Gi springboot-demo
cd ..
#rm -rf tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment