Skip to content

Docker Volume

Posted on:January 2, 2024 at 10:56 PM

tp.web.random_picture

Notes on Docker Volume.

Table of contents

Open Table of contents

Introduction

When we’re actively working on our codebase we certainly want our changes to reflect immediately inside our running Docker container. Rebuilding the whole image after every tiny change is not an ideal solution. There comes the Docker volumes.

Docker Volume Representation

It’s a process identical to port mapping but for folders/directories.

Command

docker run -p 3000:3000 -v /app/node_modules -v $(pwd):/app {image-id}

Here