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,520 points
51 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
• 25,180 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
• 40,420 points
86 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,510 points
72 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
185 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,520 points
150 views
0 votes
2 answers

How do I run a docker image as a container?

You could probably follow these steps : $ docker ...READ MORE

answered Aug 9 in Docker by Sirajul
• 25,180 points
88 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
• 25,180 points
162 views