dksnap - Docker Snapshots for Dev & Test Data

栏目: IT技术 · 发布时间: 5年前

内容简介:When testing locally we often use containers withFor a full description check out this

dksnap

dksnap creates, views, and runs snapshots of Docker containers.

When testing locally we often use containers with test data . dksnap allows you to snapshot those containers at a good state, and roll back or forward as needed.

For a full description check out this blogpost .

dksnap - Docker Snapshots for Dev & Test Data

Install

Install on MacOS or Linux:

curl https://kelda.io/install-dksnap.sh | sh

Or download the latest release and copy to your path.

Demo

Watch the demo , or try it yourself with step-by-step instructions :

# Download the demo.
git clone https://github.com/kelda/dksnap.git
cd dksnap/demo

# Start the example application. You can access it in your browser at localhost:8080.
docker-compose up -d

# Use dksnap to create snapshots of the entries in the Mongo database.
dksnap

Key Features

Create Snapshots

dksnap - Docker Snapshots for Dev & Test Data

Create a snapshot of any running Docker container. dksnap works with any container, but has extra features for select databases.

  • Snapshots are volume aware. They will capture data in volumes as well as in the container image.
  • Snapshots are database aware. When snapshotting databases that implement the plugin interface , dksnap will politely ask the database process to dump its contents before creating a Docker image.

View Snapshots

dksnap - Docker Snapshots for Dev & Test Data

dksnap includes a terminal browser that provides a tree view of all your snapshots along with diffs showing how they've changed over time.

Replace Running Containers

dksnap - Docker Snapshots for Dev & Test Data

Replace a running Docker container with a snapshot taken in the past. dksnap will automatically shut down the running container, boot the snapshot image, and restart the container using the same Docker command arguments.

Other Features

Works With Any Container

By default, dksnap creates snapshots by committing the container's filesystem with docker commit , and dumping the contents of all attached volumes.

Database Awareness

dksnap is database aware, meaning it knows how to politely dump and restore and diff database contents for the following databases:

  • Mongo
  • Postgres
  • MySQL

It has a plugin architecture making it easy to add more databases in the future. Contributions welcome!

Docker Images

dksnap images are simply docker images with some additional metadata. This means they can be viewed and manipulated using the standard docker command line tools.

Share Snapshots

dksnap stores all of the snapshot information in a docker image, so you can share your snapshot by pushing it to a Docker registry just like you would any other container image.

Volume Awareness

Snapshots are volume aware. The official database images all store their data in volumes which docker commit does not capture. dksnap saves volumes in addition to the container filesystem.

FAQ

How is this different than docker commit ?

dksnap uses docker commit for its generic snapshot approach to capture the container’s filesystem. However, docker commit has distinct limitations:

  • It doesn't capture volumes, so it can't be used with most database docker images.
  • It isn't database aware. It doesn't politely save/restore database state meaning it's prone to creating corrupted database images.

How is this different than a Docker image?

dksnap uses Docker images as the storage format for its snapshots, which makes them fully compatible with all of the things you would normally do with an image (run, push, delete, etc). You could handcraft Docker images to mimic dksnap snapshots, but dksnap makes it easy to create them from running containers.

Roadmap

  • Automated snapshot creation from production and staging databases in CI.
  • A non-graphical CLI interface that's scriptable.
  • Native support for additional databases.
  • Snapshot of CPU and RAM state.

Contributing

dksnap is still in alpha and under heavy development. Contributions are very much welcome so please get involved. Check out the contribution guidelines to get started.

Build

dksnap requires being built with go version 1.13 or later.

It uses Go Modules, and error wrapping .

git clone https://github.com/kelda/dksnap
cd dksnap
GO111MODULE=on go build .
./dksnap

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

产品设计思维

产品设计思维

王丁 / 机械工业出版社 / 2017-8-1 / 79

这是一本关于“产品设计思维与方法”方面的实战书籍。融合了笔者多年行为实践经验,以大量的图例和案例详细展现产品设计背后的真实思维与构建方法,全面系统地分析电子商务产品设计方案,从规划、架构、逻辑、原型等多个方面对电商平台的产品设计过程进行细致分享。 在互联网产品设计领域,设计理念与设计方法却是能持续复用的,只要你掌握了一套行之有效的互联网产品设计方法论与工具,那无论是从事什么样的行业,你都能快......一起来看看 《产品设计思维》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具