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 in Docker by Sam
• 1,070 points
17 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 by Sirajul
• 5,960 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 in Docker by Kalgi
• 37,320 points
71 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,490 points
60 views
0 votes
1 answer

Different file owner inside Docker container and in host machine

Here is what you can try. Since ...READ MORE

answered Jun 27, 2018 in Docker by Atul
• 10,240 points
121 views
0 votes
1 answer
0 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
• 56,160 points
99 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 in Docker by Sirajul
• 5,960 points
52 views
0 votes
1 answer