The official Docker mariadb image will run all *.sh and *.sql scripts in its /docker-entrypoint-initdb.d directory automatically when it starts. Table of contents: 1. Create an init.sql 2. Run an init script for Docker MariaDB 3. Access the MariaDB running container 4. References Technologies used: Docker 24.0.5 Official Docker mariadb image (latest tag) 1. Create […]

Read more How to run an init script for Docker MariaDB

The official Docker postgres image will run all *.sh and *.sql scripts in its /docker-entrypoint-initdb.d directory automatically when it starts. Table of contents: 1. Create an init.sql 2. Copy init.sql to container 3. Start the Postgres container 4. Access the Postgres container 5. References Technologies used: Docker 24.0.5 Official Docker postgres image (latest) 1. Create […]

Read more How to run an init script for Docker Postgres

This article shows how to test the Spring Boot REST endpoints using TestRestTemplate and Testcontainers (PostgreSQL container). Technologies used : Spring Boot 3.1.2 (Spring Web MVC, Spring Data JPA and Spring Test) Testcontainers 1.19.0 PostgreSQL 15, Alpine Linux base image postgres:15-alpine Java 17 JUnt 5 Tables of contents: 1. Project Structure 2. Project Dependencies 3. […]

Read more Spring Boot Testcontainers Example

This article shows how to create or scaffold a Gradle + Quarkus JAX-RS hello world project, which creates a /hello endpoint and returns a string. Technologies used: Quarkus 1.11.0 Gradle 6.7 Maven 3.6.3 Java 11 Topics Creating a new Gradle + Quartus project Gradle + Quarkus Project Structure Quarkus and build.gradle Quarkus Dependencies (runtimeClasspath) Quarkus […]

Read more Gradle + Quarkus Hello World example

docker run a container, but it displayed nothing, no output, no error? docker ps shows no running container? Terminal $ docker run -d -p 80:8080 -p 443:8443 -t markdownhtml:1.1 8eba06d44bf236109cf65b7b93842e9c898370cac1740aa2bab557a0fc8e52b9 $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES Solution Most of the time, the container hit an error and exited automatically. We […]

Read more Docker run but no output?

If bash shell is not working, try sh. Terminal $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3d1588519433 markdownhtml:0.1 "java -jar app.jar" About an hour ago Up About an hour 0.0.0.0:80->8080/tcp gracious_haibt $ docker exec -it 3d1588519433 bash OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bash\": executable […]

Read more Docker – exec: "bash": executable file not found in $PATH

The jcmd is available at the JDK/bin, not JRE. Make sure the installed Java is JDK, not JRE. Let review the following example, try to use jcmd to enable Java Flight Recorder inside a docker container. 1. DockerFile A simple Dokcerfile. Dockerfile FROM adoptopenjdk/openjdk11:alpine-jre ARG JAR_FILE=target/markdown.jar WORKDIR /opt/app COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","app.jar"] 2. Docker […]

Read more Java – jcmd not found?