What is the VOLUME instruction good for in Docker?
Experience Level: Senior
Tags: Docker
Answer
The VOLUME instruction creates a mount point with the specified name and marks it as holding externally mounted volumes from native host or other containers. The value can be a JSON array, VOLUME ["/var/log/"], or a plain string with multiple arguments, such as VOLUME /var/log or VOLUME /var/log /var/db.
Example:
FROM ubuntu
VOLUME /myvol
Related Docker job interview questions
What is the CMD instruction good for in Docker?
Docker SeniorWhat is the EXPOSE instruction good for in Docker?
Docker SeniorCan the WORKDIR instruction resolve environment variables in Docker?
Docker SeniorWhat is the WORKDIR instruction good for in Docker?
Docker SeniorWhat is the USER instruction good for in Docker?
Docker Senior