[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.4:build-image (default) on project twitter-to-kafka-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.7.4:build-image failed: Connection to the Docker daemon at 'localhost' failed with error "[13] Permission denied"; ensure the Docker daemon is running and accessible: com.sun.jna.LastErrorException: [13] Permission denied -> [Help 1]
I get the above error when I try to create an image using the spring-boot-maven-plugin. To solve the problem, I gave all privileges to the terminal with sudo su
and the problem was solved.
However, I ran into a more interesting problem. Normal user cannot access the image created after typing sudo su
. So in the Docker Desktop application, and when I type docker images
in the terminal, I can't see the created images. Whenever I type sudo su
and then docker images
then I can view it. I don't want it to be this way either. Because it is easier to use Docker Desktop application.
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sudo su
[sudo] password for umut:
root@umut-ThinkPad-E14-Gen-2:/home/umut# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
paketobuildpacks/run base-cnb 320a67ab6606 2 weeks ago 87.8MB
tedex123/twitter-to-kafka-service 0.0.1-SNAPSHOT a94cc13fed95 42 years ago 291MB
paketobuildpacks/builder base 49d8ba727b2b 42 years ago 1.34GB