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,765 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,350 points
2,248 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,460 points
2,434 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
963 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,020 points
2,738 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,623 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
6,204 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