Glad it worked! Sure, let me help you out.
In your Dockerfile you are trying to run the application with maven but yet inherit from the openjdk:8-jdk-alpine image, hence no maven is installed. Depending on what you extend your Dockerfile from, you will end up in a different working environment. Right now you work with an alpine linux, which has java installed. You could manually install maven by adding RUN apk add maven
to your Dockerfile (RUN is a Docker instruction, apk is the package manager of alpine linux). But the easier (and more common) approach is to extend from maven:3-jdk-8, which has maven already preinstalled. By the way: Dockerhub is the official container registry for Docker (works the same way as your GitLab registry). It’s for Docker what the maven central is for java, or pypi for python. I see you often work with python. You might want to check out python or jupyter containers.
Long story short: Change FROM openjdk:8-jdk-alpine
to FROM maven:3-jdk-8
in your Dockerfile. Let me know if it worked!
Regarding your mysql database question: I’m currently working on an article about “Getting Started with Docker” which will address your concern. If you can’t wait :-), here’s the (or “a”) basic concept to achieve your goal:
- Create a Docker network for your application stack.
- Start a mysql Docker container and connect it to the network.
- Start your webapp container and connect it to the network. Within your webapp, use the mysql container name as hostname for the database.
Cheers, Mike