A demo project which shows how to configure building, running and publishing of Docker image with your application.
Make sure you have Docker installed (you also can use Podman as alternative). Please make sure the Docker daemon is up and running before building an image.
To build an image to the local Docker registry run:
./gradlew jibDockerBuild
If you are using Minikube's remote Docker daemon, make sure you set up the correct environment variables to point to the remote daemon:
eval $(minikube docker-env)
./gradlew jibDockerBuild
After that you can see ktor-container-image:0.0.1
in your local image registry. The version of the image is taken from your project configuration.
docker run -p 8080:8080 ktor-container-image:0.0.1
To build an image to an external registry you should run:
IMAGE=`MY IMAGE PAHT` # gcr.io/my-gcp-project/my-app or aws_account_id.dkr.ecr.region.amazonaws.com/my-app
./gradlew jib --image=$IMAGE