By rvaid
I was able to copy the mongodb dump zip file on to the pod but I am not able to unzip it. I tried to install unzip package but apt-get is throwing an error: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
And is there way to get root access to the pod shell ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
In order for you to get root access to the container that is running inside a pod on the Managed Kubernetes cluster, your container needs to be running as the root user.
What you could do instead is, while building your Docker image you could install the unzip command, that way it would be available once you start the container. To do that you just need to add the following to your Dockerfile:
RUN apt update -y && \
apt install unzip -y
Hope that this helps! Regards, Bobby
Another approach you could take to not affect your image would be to have it already extracted locally to some dir locally, then use kubectl cp command to copy the contents of that directory to the pod.
I do want to point out that unless where you’re copying the data to is backed by persistent storage all data copied to a pod will be lost on a container restart.
Regards,
John Kwiatkoski Senior Developer Support Engineer - Kubernetes
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.