docker2aci

command module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

README

docker2aci - Convert docker images to ACI

Build Status

docker2aci is a small library and CLI binary that converts Docker images to ACI. It takes as input either a file generated by "docker save" or a Docker registry URL. It gets all the layers of a Docker image and squashes them into an ACI image. Optionally, it can generate one ACI for each layer, setting the correct dependencies.

All ACIs generated are compressed with gzip by default. Compression can be disabled by specifying --compression=none.

Build

git clone git://github.com/appc/docker2aci
cd docker2aci
./build.sh

Volumes

Docker Volumes get converted to mountPoints in the Image Manifest Schema. Since mountPoints need a name and Docker Volumes don't, docker2aci generates a name by appending the path to volume- replacing non-alphanumeric characters with dashes. That is, if a Volume has /var/tmp as path, the resulting mountPoint name will be volume-var-tmp.

When the docker2aci CLI binary converts a Docker Volume to a mountPoint it will print its name, path and whether it is read-only or not.

Ports

Docker Ports get converted to ports in the Image Manifest Schema. The resulting port name will be the port number and the protocol separated by a dash. For example: 6379-tcp.

CLI examples

$ docker2aci docker://busybox
Downloading sha256:55dc925c23d: [==============================] 674 KB/674 KB
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B

Generated ACI(s):
library-busybox-latest.aci
$ actool --debug validate library-busybox-latest.aci
library-busybox-latest.aci: valid app container image
$ /docker2aci --nosquash docker://quay.io/coreos/etcd:latest
Downloading sha256:f05e5379dcb: [==============================] 3.98 MB/3.98 MB
Downloading sha256:af1897d2d32: [==============================] 3.5 MB/3.5 MB
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B

Converted ports:
        name: "2379-tcp", protocol: "tcp", port: 2379, count: 1, socketActivated: false
        name: "2380-tcp", protocol: "tcp", port: 2380, count: 1, socketActivated: false
        name: "4001-tcp", protocol: "tcp", port: 4001, count: 1, socketActivated: false
        name: "7001-tcp", protocol: "tcp", port: 7001, count: 1, socketActivated: false

Generated ACI(s):
coreos-etcd-d21dd9a5886270b7c2c379c02fc548e0696b139c43bb12fdb2d9b63409717485-latest-linux-amd64-3.aci
coreos-etcd-620329641f386e62c7b0e0fa60a9acef100e71058124ddc7f1969557c72b2458-latest-linux-amd64-2.aci
coreos-etcd-9cd3f08f7ccfaad24c73757a5b4f79601f2790726d6ccdd556a82e5c9c5ddbfa-latest-linux-amd64-1.aci
coreos-etcd-9cd3f08f7ccfaad24c73757a5b4f79601f2790726d6ccdd556a82e5c9c5ddbfa-latest-linux-amd64-0.aci
$ docker save -o ubuntu.docker ubuntu
$ docker2aci ubuntu.docker
Extracting 706766fe1019
Extracting a62a42e77c9c
Extracting 2c014f14d3d9
Extracting b7cf8f0d9e82

Generated ACI(s):
ubuntu-latest.aci
$ actool --debug validate ubuntu-latest.aci
ubuntu-latest.aci: valid app container image
$ docker2aci docker://redis
Downloading sha256:c666c10c893: [==============================] 37.2 MB/37.2 MB
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:d6f52360d0a: [==============================] 1.69 KB/1.69 KB
Downloading sha256:8c3a687fd4c: [==============================] 5.93 MB/5.93 MB
Downloading sha256:15554e0e598: [==============================] 109 KB/109 KB 
Downloading sha256:3286d490a29: [==============================] 611 KB/611 KB 
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3d89b95a63: [==============================] 3.04 MB/3.04 MB
Downloading sha256:1c4db557158: [==============================] 98 B/98 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a1a961e320b: [==============================] 196 B/196 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B
Downloading sha256:a3ed95caeb0: [==============================] 32 B/32 B

Converted volumes:
        name: "volume-data", path: "/data", readOnly: false

Converted ports:
        name: "6379-tcp", protocol: "tcp", port: 6379, count: 1, socketActivated: false

Generated ACI(s):
library-redis-latest.aci
$ actool --debug validate library-redis-latest.aci
library-redis-latest.aci: valid app container image

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/appc/spec/aci
Package aci contains various functions for working with App Container Images.
Package aci contains various functions for working with App Container Images.
_workspace/src/github.com/appc/spec/pkg/tarheader
Package tarheader contains a simple abstraction to accurately create tar.Headers on different operating systems.
Package tarheader contains a simple abstraction to accurately create tar.Headers on different operating systems.
_workspace/src/github.com/appc/spec/schema
Package schema provides definitions for the JSON schema of the different manifests in the App Container Specification.
Package schema provides definitions for the JSON schema of the different manifests in the App Container Specification.
_workspace/src/github.com/appc/spec/schema/types
Package types contains structs representing the various types in the app container specification.
Package types contains structs representing the various types in the app container specification.
_workspace/src/github.com/docker/distribution/digest
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
_workspace/src/github.com/docker/distribution/reference
Package reference provides a general type to represent any way of referencing images within the registry.
Package reference provides a general type to represent any way of referencing images within the registry.
_workspace/src/github.com/gogo/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/klauspost/compress/flate
Package flate implements the DEFLATE compressed data format, described in RFC 1951.
Package flate implements the DEFLATE compressed data format, described in RFC 1951.
_workspace/src/github.com/klauspost/cpuid
Package cpuid provides information about the CPU running the current program.
Package cpuid provides information about the CPU running the current program.
_workspace/src/github.com/klauspost/crc32
Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum.
Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum.
_workspace/src/github.com/klauspost/pgzip
Package pgzip implements reading and writing of gzip format compressed files, as specified in RFC 1952.
Package pgzip implements reading and writing of gzip format compressed files, as specified in RFC 1952.
_workspace/src/github.com/spf13/pflag
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/go4.org/errorutil
Package errorutil helps make better error messages.
Package errorutil helps make better error messages.
_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/gopkg.in/inf.v0
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
_workspace/src/k8s.io/kubernetes/pkg/api/resource
Package resource is a generated protocol buffer package.
Package resource is a generated protocol buffer package.
_workspace/src/k8s.io/kubernetes/pkg/conversion
Package conversion provides go object versioning.
Package conversion provides go object versioning.
_workspace/src/k8s.io/kubernetes/third_party/forked/reflect
Package reflect is a fork of go's standard library reflection package, which allows for deep equal with equality functions defined.
Package reflect is a fork of go's standard library reflection package, which allows for deep equal with equality functions defined.
lib
Package docker2aci implements a simple library for converting docker images to App Container Images (ACIs).
Package docker2aci implements a simple library for converting docker images to App Container Images (ACIs).
common
Package common provides misc types and variables.
Package common provides misc types and variables.
internal
Package internal provides functions shared by different parts of docker2aci.
Package internal provides functions shared by different parts of docker2aci.
internal/backend/file
Package file is an implementation of Docker2ACIBackend for files saved via "docker save".
Package file is an implementation of Docker2ACIBackend for files saved via "docker save".
internal/backend/repository
Package repository is an implementation of Docker2ACIBackend for Docker remote registries.
Package repository is an implementation of Docker2ACIBackend for Docker remote registries.
internal/tarball
Package tarball provides functions to manipulate tar files.
Package tarball provides functions to manipulate tar files.
internal/types
Package types defines Docker image, URL and configuration types.
Package types defines Docker image, URL and configuration types.
internal/util
Package util defines convenience functions for handling slices and debugging.
Package util defines convenience functions for handling slices and debugging.
pkg
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL