Since I could not find a docker image on dockerhub that has maven 3.8.1, open jdk 11 and docker installed, I tried to create one with a Dockerfile. I am new to this hence facing issues. Below is how my Dockerfile looks like
FROM maven:3.8.1-adoptopenjdk-11
RUN apt update -y
RUN apt install -y curl
RUN curl https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz | tar xvz -C /tmp/ && mv /tmp/docker/docker /usr/bin/docker
RUN docker ps
When I execute docker build -t demo .
I get the below error logs
docker/docker-containerd
38 27.1M 38 10.3M 0 0 18.5M 0 0:00:01 --:--:-- 0:00:01 18.5Mdocker/docker-proxy
docker/docker-containerd-ctr
docker/dockerd
docker/docker-runc
100 27.1M 100 27.1M 0 0 19.7M 0 0:00:01 0:00:01 --:--:-- 19.7M
Removing intermediate container f4cd71aa05d2
---> 7b0055db2e58
Step 5/5 : RUN docker ps
---> Running in 83919a2985bf
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
My goal is to create a Dockerfile that could be used in a jenkins pipeline to build a maven spring boot project (mvn spring-boot:build-image
). Could someone guide me on the Dockerfile?
Thanks.