Docker Volume Without going through Docker, accessing files within a Docker image is not easy. Therefore, Docker has a volume feature that allows users to specify the location on the host file system to serve as the access directory for Docker. In other words, a volume is the NFS of a Docker image. Example: Using a volume to store SQLite files. ref: SQLite for NodeJS: https://www.sqlitetutorial.net/sqlite-nodejs/ Initialize the project. # Setup ExpressJS framework express --view=pug 240324_ejs_sqlite_docker npm init npm install express npm install sqlite3 Test: npm start Initialize docker Since the directory already contains NodeJS, the Docker Daemon will assist in the setup. Create new docker image docker build -t atfuture7/sqlite01 . Create a folder for Docker, create a container, run it. mkdir docker_vol docker run -p 3000:3000 -v ./docker_vol:/data --name exp_sqlite atfuture7/sqlite01 After confirming that the container can run correctly, stop the container a
Previously, my work platform involved using development, testing, and production environments. Docker is relatively new to me. As I also held a system administrator role, the characterization of Docker as "lightweight and simple" by supporters in the programming development community left me puzzled for a while. Here's a brief explanation of the differences between VMs, Docker, and Virtual Desktops as I understand them. The platforms most people commonly interact with are standalone systems, which typically include Windows, Mac, Android, and iOS. In the early Unix era, the system architecture consisted of a Host and Terminals. Terminals are lightweight systems with basic functions, which can also be seen today in devices like the Raspberry Pi. When work requires several systems to perform different tasks, having a separate hardware device for each can be wasteful. This led to the development of Hypervisor and VM (Virtual Machine) architectures. Sometimes institutions ne