it's not possible.
let me explain : you need to think of it like two different machine
. here your local machine is the one where the file exist and you want to copy it in another machine with cp
. but it's not possible. and this is what you are trying to do here. you are trying to copy file from your machine to pod
's machine.
here you can do one thing just create your own docker image for init-container
. and copy the file you want to store before building the docker image. then you can copy that file in shared volume
where you want to store the file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…