Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
- Save the image as a tarball
docker save repositoryname:tag > repotag.tar
- Zip the image
| ############################################################################### | |
| # The MIT License | |
| # | |
| # Copyright 2012-2014 Jakub Jirutka <[email protected]>. | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
| // # Mocha Guide to Testing | |
| // Objective is to explain describe(), it(), and before()/etc hooks | |
| // 1. `describe()` is merely for grouping, which you can nest as deep | |
| // 2. `it()` is a test case | |
| // 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
| // before/after first/each it() or describe(). | |
| // | |
| // Which means, `before()` is run before first it()/describe() |
Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
docker save repositoryname:tag > repotag.tar
| 'use strict'; | |
| describe('mocha before hooks', function () { | |
| before(() => console.log('*** top-level before()')); | |
| beforeEach(() => console.log('*** top-level beforeEach()')); | |
| describe('nesting', function () { | |
| before(() => console.log('*** nested before()')); | |
| beforeEach(() => console.log('*** nested beforeEach()')); | |
| it('is a nested spec', () => true); | |
| }); |
| version: '2' | |
| services: | |
| postgres: | |
| image: postgres:9.5 | |
| restart: always | |
| environment: | |
| - "POSTGRES_USER=${POSTGRES_USER}" | |
| - "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" | |
| - "POSTGRES_DB=gogs" | |
| volumes: |
| version: '2' | |
| services: | |
| myapp: | |
| build: . | |
| container_name: "myapp" | |
| image: debian/latest | |
| environment: | |
| - NODE_ENV=development | |
| - FOO=bar | |
| volumes: |