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
429 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
• 58,950 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 22, 2019 in Docker by Kalgi
• 52,290 points
434 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
• 94,990 points
72 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,990 points
265 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,080 points
986 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,990 points
394 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
• 58,950 points
2,413 views