For context, I’m building a java application compiled to GraalVM native image running on a distroless docker image in Kubernetes. I’ve been trying to do something rather simple and hit a wall: I’d like to set custom heap size limits per environment via -XmxNNN. To do that, the options with which I’d like to run the application would be held
Tag: docker
How to handle Docker-Secrets in application.properties files
How do you inject Docker secrets (files/data from /run/secrets) into the application.properties files? Is it safe to use environment variables? Answer First of all, usage of environment variables for secret data for the application.properties isn’t safe. You have mainly two options when talking about Secrets. If you are using Docker Secrets without Docker Swarm then you can directly load the
How to manage memory using Spring Boot Maven Plugin with Kubernetes
I’m using spring boot 2.5.6 and I’m generating the docker image with the spring boot maven plugin. I’m deploying the application using AWS EKS with nodes managed by fargate. The plugin configuration is the following The command I use to execute it is the following When the application is deployed on AWS EKS, the application print the following data If
Kafka Connect Error : java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager
I’m using docker with kafka and clickhouse. I want to connect ‘KsqlDB table’ and ‘clickhouse’ using ‘kafka connect’. So I referred to this document and modified ‘docker composite’. here is my docker-compose And This is Dockerfile-kafka-connect And I typed this command in ‘KsqlDB’. (‘S3_FINAL’ topic has AVRO format for both multi-key and values.) And It doesn’t work. So I read
Unable to connect to local dynamo-db instance in java
I am testing my application which uses dynamoDB. I have started an instance locally using docker and I’m able to create / add items in the instance. Now, inside my Java application, I am trying to connect to my local and when I’m sending an API call that interacts with my local Dynamo, it throws an error – Unable to
How connect to db when running Dockerfile?
I have a spring boot app that connects fine to my PostgreSQL server running locally in Desktop Docker. Than I wrote a simple Dockerfile to run my app in container. Container starts but can’t connect to my db server with error message: Connection to localhost:5432 refused. Why and how to fix this? Answer To access localhost from inside a docker
Spring Boot Docker Native image of Spring R2DBC application on Java 16 fails on unsupported methdod
I have a simple application built on top of org.springframework.boot:spring-boot-starter-parent version 2.5.4-SNAPSHOT and some derived dependencies: org.springframework.boot:spring-boot-starter-data-r2dbc org.springframework.boot:spring-boot-starter-webflux org.springframework.boot:spring-boot-starter-actuator io.r2dbc:r2dbc-postgresql I use org.springframework.experimental:spring-native version 0.10.3 to enable Spring Native and build using the following plugin: I build the image using ./mvnw.cmd spring-boot:build-image -Pnative-docker -DskipTests, I get assured Java 16 is bootstrapped correctly, and then the image exists (why it is
Application build is successful but getting error: ‘no main manifest attribute, in app.jar’ while running the image
I am trying to deploy my spring boot application on a docker. I have created a docker file as follows. The docker file builds fine but when I run the image it throws the following error: Please note that my application runs on JDK 11, maven build and already added dependency for spring-boot-maven-plugin. I couldn’t find a proper solution for
How to deploy stack with docker-java client?
How to deploy stack with docker-java client? ex) docker stack deploy –compose-file docker-compose.yml stackdemo Is there any function to run this command in java client? Answer If you want to execute multiple commands I suggest you to write a shell script file and execute it from the java code. Another option if you want to only run 1 command you
adoptopenjdk alpine vs alpine-slim in AdoptOpenJDK maintained images
In the AdoptOpenJDK maintained images docker hub repo i see that among others there are two builds for alpine namely alpine & alpine-slim. I downloaded both & see a good 81 MB difference in the image size (see below) between both. I tried using the alpine-slim image to build & up my services and didn’t see any issues. I am