Mount a volume and run a docker container in read-only mode

0 votes
I need to run a container using the image alpine and mount the volume xy-products in read-only mode into /data container folder.How do I do it?
Jul 3, 2019 in Docker by Sam
• 6,260 points
1,536 views

1 answer to this question.

0 votes

You can achieve this using the following

$ docker container run -it --rm \
  -v xy-products:/data:ro \
  alpine /bin/sh

Hope this helps!

answered Jul 3, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 23, 2019 in Docker by Kalgi
• 52,360 points
1,831 views
+1 vote
1 answer

How to mount a host directory in a Docker container?

Hi@akhtar, You can use the -v option in ...READ MORE

answered Dec 23, 2020 in Docker by MD
• 95,440 points
2,034 views
0 votes
1 answer

Different file owner inside Docker container and in host machine Ask

Filesystems, at least in Unix- and Linux-like ...READ MORE

answered Jun 25, 2018 in Docker by Damon Salvatore
• 5,980 points
737 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,472 views
+1 vote
2 answers

How do I run a docker image as a container?

You can run an image depends on whether you ...READ MORE

answered Sep 7, 2018 in Docker by Damon Salvatore
• 5,980 points
1,316 views
0 votes
1 answer

Can I run docker-compose inside a container?

Compose can also be run inside a ...READ MORE

answered Jun 10, 2019 in Docker by Sirajul
• 59,230 points
5,781 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP