Categories
User Help

Docker openjdk image how do I find the nginx logs in my spring boot image

I’m new to docker. I googled and didn’t find anything. I’m deploying my image built on a openjdk image with a spring boot application. Here’s my Dockerfile. FROM openjdk:11 ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Dspring.profiles.active=${SPRING_PROFILE}","-jar","/app.jar"] The problem is that I’m getting a 405 in my browser when I try to hit APIs in my […]

Categories
Mastering Development

Connection refused in Docker container between database container and java container in docker

I am using docker compose to start a mysql da and a springboot app. This is my docker-compose.yml version: ‘3’ services: sql: image: mysql environment: MYSQL_DATABASE: people MYSQL_USER: root MYSQL_PASSWORD: my-secret-pw MYSQL_ROOT_PASSWORD: my-secret-pw ports: – "3307:3306" appointment-service: depends_on: – sql # This service depends on mysql. Start that first. environment: # Pass environment variables to […]

Categories
Mastering Development

How to configure JVM hotspot configurations for Spring Boot application when running inside docker?

I’m using the Dockerfile to pass the JVM configuration as follows. FROM openjdk:11 COPY build/libs/api.jar /app/ EXPOSE 8080 ENTRYPOINT ["java", "-Xms256m", "-Xmx256m", "-jar", "app/api.jar"] After building and running the container I goto the bash inside the container and execute java -XX:+PrintFlagsFinal -version | grep MaxHeapSize command to check if it is configured correctly. But the […]

Categories
Mastering Development

How to read from input file inside docker container

I have a simple program in java which is run inside docker container. I used Eclipse On windows – But I created the linux containers (with windwos docker desktop) I used Powershell to start container The image is successfully created I saw this thread but it didnt help me c++ program with docker. I have […]

Categories
Linux Mastering Development

Unexpected arguments error appearing on the command line when running mapreduce job (MRjob) using python

I am fairly new to this process. I am trying to run a simple map-reduce job using python 3.8 with a csv on a local Hadoop cluster (Hadoop version 3.2.1). I am currently running it on Windows 10 (64-bit). The aim of what I’m trying to do is to process a csv file where I […]

Categories
Mastering Development

Behaviour discrepancy with Docker container

I am developing a small Java app that is supposed to check an email inbox. When I deploy it in my production environment and execute the jar, the connection to the inbox is well established using the port 110. Issue: I put the jar within its own Docker container, the port 995 (secured connection) is […]

Categories
Mastering Development

JavaFX on Docker Container

I’m currently trying to integrate my perfectly working toDoList.jar file into a docker container(OpenJDK14 on linux alpine). I’m able to build the image which also copys JavaFX into the image, but when I try to run the container I get the following error: Error C:\Users\jkcar\IdeaProjects\toDoList>docker run todolist Error occurred during initialization of boot layer java.lang.module.FindException: […]

Categories
Mastering Development

The command /bin/sh -c gradle run returned a non-zero code: 127

Following is my dockerfile FROM openjdk:11.0.7-jdk ENV APP_HOME=/root/dev/beverage WORKDIR $APP_HOME COPY . $APP_HOME RUN gradle run CMD ["java", "-jar", "build/libs/beverage-all.jar"] When I try on the docker following command docker build -t beverage . it throws the following error /bin/sh: 1: gradle: not found The command ‘/bin/sh -c gradle run’ returned a non-zero code: 127 I […]

Categories
Mastering Development

Docker Compose connect to external Postgres databases

I have a SpringBoot application that works perfectly. Now I am trying to Dockerise it, but have some issues when connecting to the database. The application has two datasources: application.properties server.port= 8081 # pims datasource spring.datasource1.driver-class-name=org.postgresql.Driver spring.datasource1.jdbc-url=jdbc:postgresql://localhost:5432/pims spring.datasource1.username=postgres spring.datasource1.password= spring.jpa.database-platform=postgres #spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.show-sql=false # approval datasource spring.datasource2.driver-class-name=org.postgresql.Driver spring.datasource2.jdbc-url=jdbc:postgresql://localhost:5432/approval spring.datasource2.username=postgres spring.datasource2.password= In the application, I use Spring […]

Categories
Mastering Development

Spring Boot cannot Dockerise jar

I have a Spring Boot application that works perfectly on port 8081. application.properties server.port= 8081 I then try Dockerise it. Dockerfile FROM openjdk:14 ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} nexct-approval-service.jar EXPOSE 8081 ENTRYPOINT ["java","-jar","/nexct-approval-service.jar"] Then I run: mvn clean install -DskipTests The nexct-approval-service-0.0.1-SNAPSHOT.jar file is built in the /target folder. I run docker build . -t nexct-approval-service.jar. […]