X-Road icon indicating copy to clipboard operation
X-Road copied to clipboard

docker build failed - missing directories

Open chaimfn opened this issue 3 years ago • 2 comments

docker build is failing at lines 48-49. Those directories are missing: /home/, /etc/.

Here is the Dockerfile: (https://github.com/nordic-institute/X-Road/blob/develop/Docker/centralserver/Dockerfile) and here is the problem: xroad-cnt-server-dockerfile-bugs

chaimfn avatar Jun 16 '21 07:06 chaimfn

Facing the same issue with building and setting up my docker container , tried creating certs on my local machine and use them in localhost:4001 ,still doesnt work

did you find any solution for this issue ?

HsnAlwayel avatar Sep 01 '22 05:09 HsnAlwayel

Hi @HsnAlwayel! Have you tried running the Central Server image that's available in Docker Hub? In that way, there's no need to build the image locally.

You can spin up a new Central Server container using this command:

docker run -p 4000:4000 -p 4001:80 -p 4002:9998 --name cs niis/xroad-central-server

Regards, Petteri

petkivim avatar Sep 01 '22 07:09 petkivim

But that image can't be used in a production environment!

UsernameAlvarez avatar Apr 10 '23 18:04 UsernameAlvarez

The content of home directory were moved to ansible/roles/xroad-ca/files/home/ca directory. I copied those CA & TSA directories inside home but not sure about etc directory.

https://github.com/nordic-institute/X-Road/tree/6d466b8d67fe5a3456fb3bbc2ff88bd9336b1241/ansible/roles/xroad-ca/files/home/ca

UsernameAlvarez avatar Apr 10 '23 20:04 UsernameAlvarez

The etc directory is needed too. Have you run the init_context.sh script before building the image and are you running the build command in the build folder? I was able to build the image successfully using the commands below.

cd Docker/centralserver/
./init_context.sh
cd build/
docker build --build-arg DIST=jammy-current -t centralserver -f ../Dockerfile .

Also, please note that building the image by yourself without changing it doesn't make it any more suitable to a production environment compared to the image available on Docker Hub.

petkivim avatar Apr 11 '23 04:04 petkivim

Where is the content of etc directory? I use go to file tools but not sure.

UsernameAlvarez avatar Apr 11 '23 12:04 UsernameAlvarez

It's here:

https://github.com/nordic-institute/X-Road/tree/develop/ansible/roles/xroad-ca/files

You can see it by looking at the init_context.sh script:

https://github.com/nordic-institute/X-Road/blob/develop/Docker/centralserver/init_context.sh

petkivim avatar Apr 11 '23 13:04 petkivim

Thank you so much.

UsernameAlvarez avatar Apr 11 '23 13:04 UsernameAlvarez