Issue
I have script that build docker image in minikube.
#set -x
ASSEMBLY_NAME=$(basename ${1})
eval $(minikube docker-env)
echo "Current user is "$USER
echo "Current user groups "$(id -Gn)
ls -la /home/user1/.minikube/certs/ca.pem
cp ${1} jdbc-puller/build/
docker build --build-arg ASSEMBLY_PATH=${ASSEMBLY_NAME} -t ${2} jdbc-puller/build
this script executed from sbt sbt dockerBuild
.
Which is custom command:
dockerBuild := {
s"""./jdbc-puller/build/linux_build.sh ${assembly.value.getAbsolutePath}
|organisation1/jdbc-puller:${gitCurrentBranch.value}_sha${gitHeadCommit.value
.getOrElse("No_Head_Commit")}""".stripLineEnd.stripMargin !
},
But i don't think that it's problem in sbt. Because script output show right users and groups:
Current user is user1
Current user groups user1 adm cdrom sudo dip plugdev lpadmin sambashare docker
-rw-r--r-- 1 user1 user1 1025 мар 23 18:35 /home/user1/.minikube/certs/ca.pem
could not read CA certificate "/home/user1/.minikube/certs/ca.pem": open /home/user1/.minikube/certs/ca.pem: permission denied
But if i run same command in shell directly:
docker build --build-arg ASSEMBLY_PATH=navision-jdbc-puller-0.1.user1.prepare-to-development-028aaddff43890720432a2f27ad193a266ecf0ad.jar -t navision/jdbc-puller:prepare-to-development_sha028aaddff43890720432a2f27ad193a266ecf0ad navision-jdbc-puller/build
result is:
Sending build context to Docker daemon 75.71MB
Step 1/7 : FROM azul/zulu-openjdk-alpine:11.0.2
---> e711110a0ad5
Step 2/7 : ARG ASSEMBLY_PATH=target/scala-2.11/sbt-1.0/assembly.jar
---> Using cache
---> 831efe890156
Step 3/7 : WORKDIR /opt/jdbc-puller
---> Using cache
---> cf252dc46acd
Step 4/7 : RUN ["chown", "-R", "daemon:daemon", "."]
---> Using cache
---> 843a834736ca
Step 5/7 : USER daemon
---> Using cache
---> ea3b9894ceb5
Step 6/7 : COPY $ASSEMBLY_PATH /opt/jdbc-puller/assmebly.jar
---> Using cache
---> 413ba469b2ef
Step 7/7 : ENTRYPOINT ["java -jar /opt/jdbc-puller/assmebly.jar"]
---> Using cache
---> 41c384cbcef6
Successfully built 41c384cbcef6
Successfully tagged navision/jdbc-puller:prepare-to-development_sha028aaddff43890720432a2f27ad193a266ecf0ad
evryhing work. additional info
getfacl: Removing leading '/' from absolute path names
# file: home/user1/.minikube/certs/ca.pem
# owner: user1
# group: user1
user::rw-
group::r--
other::r--
Please explain where I am wrong or at least what to next I can check.
Solution
Ok, i find a problem. There was two bug.
One is mine,
I do not run in terminal eval $(minikube docker-env)
.
Second one in minikube in ubuntu if minikube or dcoker instaled from snap. here us answer for issue http://computerbryan.com/minikube-on-ubuntu.html.
Answered By - Grigoriev Nick Answer Checked By - Timothy Miller (WPSolving Admin)