mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-19 12:16:30 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ddecf74be |
@@ -30,8 +30,5 @@ docs/_build
|
||||
docs/_static
|
||||
docs/_templates
|
||||
docs/changed-files
|
||||
# generated by man/man/md2man-all.sh
|
||||
man/man1
|
||||
man/man5
|
||||
pyenv
|
||||
vendor/pkg/
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
#### Quality
|
||||
* Networking stack was entirely rewritten as part of the libnetwork effort
|
||||
* Engine internals refactoring
|
||||
* Engine internals refactoring (shout out to the contributors?)
|
||||
* Volumes code was entirely rewritten to support the plugins effort
|
||||
+ Sending SIGUSR1 to a daemon will dump all goroutines stacks without exiting
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ security@docker.com and not by creating a github issue.
|
||||
|
||||
A common method for distributing applications and sandboxing their
|
||||
execution is to use virtual machines, or VMs. Typical VM formats are
|
||||
VMware's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory
|
||||
VMWare's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory
|
||||
these formats should allow every developer to automatically package
|
||||
their application into a "machine" for easy distribution and deployment.
|
||||
In practice, that almost never happens, for a few reasons:
|
||||
|
||||
+33
-14
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/docker/docker/pkg/version"
|
||||
"github.com/docker/docker/runconfig"
|
||||
"github.com/docker/docker/utils"
|
||||
"github.com/docker/libnetwork/portallocator"
|
||||
)
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -398,7 +399,6 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
|
||||
}
|
||||
until = u
|
||||
}
|
||||
|
||||
timer := time.NewTimer(0)
|
||||
timer.Stop()
|
||||
if until > 0 {
|
||||
@@ -457,9 +457,6 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
|
||||
}
|
||||
|
||||
current, l := es.Subscribe()
|
||||
if since == -1 {
|
||||
current = nil
|
||||
}
|
||||
defer es.Evict(l)
|
||||
for _, ev := range current {
|
||||
if ev.Time < since {
|
||||
@@ -575,16 +572,7 @@ func (s *Server) getContainersStats(version version.Version, w http.ResponseWrit
|
||||
return fmt.Errorf("Missing parameter")
|
||||
}
|
||||
|
||||
stream := boolValueOrDefault(r, "stream", true)
|
||||
var out io.Writer
|
||||
if !stream {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
out = w
|
||||
} else {
|
||||
out = ioutils.NewWriteFlusher(w)
|
||||
}
|
||||
|
||||
return s.daemon.ContainerStats(vars["name"], stream, out)
|
||||
return s.daemon.ContainerStats(vars["name"], boolValueOrDefault(r, "stream", true), ioutils.NewWriteFlusher(w))
|
||||
}
|
||||
|
||||
func (s *Server) getContainersLogs(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
@@ -668,6 +656,10 @@ func (s *Server) postCommit(version version.Version, w http.ResponseWriter, r *h
|
||||
return err
|
||||
}
|
||||
|
||||
if c == nil {
|
||||
c = &runconfig.Config{}
|
||||
}
|
||||
|
||||
containerCommitConfig := &daemon.ContainerCommitConfig{
|
||||
Pause: pause,
|
||||
Repo: r.Form.Get("repo"),
|
||||
@@ -1584,3 +1576,30 @@ func createRouter(s *Server) *mux.Router {
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
func allocateDaemonPort(addr string) error {
|
||||
host, port, err := net.SplitHostPort(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
intPort, err := strconv.Atoi(port)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var hostIPs []net.IP
|
||||
if parsedIP := net.ParseIP(host); parsedIP != nil {
|
||||
hostIPs = append(hostIPs, parsedIP)
|
||||
} else if hostIPs, err = net.LookupIP(host); err != nil {
|
||||
return fmt.Errorf("failed to lookup %s address in host specification", host)
|
||||
}
|
||||
|
||||
pa := portallocator.Get()
|
||||
for _, hostIP := range hostIPs {
|
||||
if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
|
||||
return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -6,12 +6,10 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/docker/docker/daemon"
|
||||
"github.com/docker/docker/pkg/sockets"
|
||||
"github.com/docker/docker/pkg/systemd"
|
||||
"github.com/docker/libnetwork/portallocator"
|
||||
)
|
||||
|
||||
// newServer sets up the required serverClosers and does protocol specific checking.
|
||||
@@ -69,30 +67,3 @@ func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
||||
close(s.start)
|
||||
}
|
||||
}
|
||||
|
||||
func allocateDaemonPort(addr string) error {
|
||||
host, port, err := net.SplitHostPort(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
intPort, err := strconv.Atoi(port)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var hostIPs []net.IP
|
||||
if parsedIP := net.ParseIP(host); parsedIP != nil {
|
||||
hostIPs = append(hostIPs, parsedIP)
|
||||
} else if hostIPs, err = net.LookupIP(host); err != nil {
|
||||
return fmt.Errorf("failed to lookup %s address in host specification", host)
|
||||
}
|
||||
|
||||
pa := portallocator.Get()
|
||||
for _, hostIP := range hostIPs {
|
||||
if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
|
||||
return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// NewServer sets up the required Server and does protocol specific checking.
|
||||
func (s *Server) newServer(proto, addr string) (serverCloser, error) {
|
||||
func (s *Server) newServer(proto, addr string) (Server, error) {
|
||||
var (
|
||||
err error
|
||||
l net.Listener
|
||||
@@ -22,7 +22,6 @@ func (s *Server) newServer(proto, addr string) (serverCloser, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
default:
|
||||
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
|
||||
}
|
||||
@@ -44,7 +43,3 @@ func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
||||
close(s.start)
|
||||
}
|
||||
}
|
||||
|
||||
func allocateDaemonPort(addr string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
+2
-2
@@ -94,9 +94,9 @@ type ImageInspect struct {
|
||||
|
||||
// GET "/containers/json"
|
||||
type Port struct {
|
||||
IP string `json:",omitempty"`
|
||||
IP string
|
||||
PrivatePort int
|
||||
PublicPort int `json:",omitempty"`
|
||||
PublicPort int
|
||||
Type string
|
||||
}
|
||||
|
||||
|
||||
@@ -221,10 +221,6 @@ func Commit(d *daemon.Daemon, name string, c *daemon.ContainerCommitConfig) (str
|
||||
return "", err
|
||||
}
|
||||
|
||||
if c.Config == nil {
|
||||
c.Config = &runconfig.Config{}
|
||||
}
|
||||
|
||||
newConfig, err := BuildFromConfig(d, c.Config, c.Changes)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=https://docs.docker.com
|
||||
Documentation=http://docs.docker.com
|
||||
After=network.target docker.socket
|
||||
Requires=docker.socket
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ sudo mkdir -m 755 dev
|
||||
# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services "$target"
|
||||
# locales
|
||||
sudo rm -rf usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
|
||||
# docs and man pages
|
||||
# docs
|
||||
sudo rm -rf usr/share/{man,doc,info,gnome/help}
|
||||
# cracklib
|
||||
sudo rm -rf usr/share/cracklib
|
||||
|
||||
@@ -10,7 +10,7 @@ shift
|
||||
# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services "$target"
|
||||
# locales
|
||||
rm -rf usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
|
||||
# docs and man pages
|
||||
# docs
|
||||
rm -rf usr/share/{man,doc,info,gnome/help}
|
||||
# cracklib
|
||||
rm -rf usr/share/cracklib
|
||||
|
||||
+38
-5
@@ -1,6 +1,8 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/docker/docker/opts"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/runconfig"
|
||||
@@ -14,7 +16,9 @@ const (
|
||||
// CommonConfig defines the configuration of a docker daemon which are
|
||||
// common across platforms.
|
||||
type CommonConfig struct {
|
||||
AutoRestart bool
|
||||
AutoRestart bool
|
||||
// Bridge holds bridge network specific configuration.
|
||||
Bridge bridgeConfig
|
||||
Context map[string][]string
|
||||
CorsHeaders string
|
||||
DisableNetwork bool
|
||||
@@ -22,10 +26,8 @@ type CommonConfig struct {
|
||||
DnsSearch []string
|
||||
EnableCors bool
|
||||
ExecDriver string
|
||||
ExecOptions []string
|
||||
ExecRoot string
|
||||
GraphDriver string
|
||||
GraphOptions []string
|
||||
Labels []string
|
||||
LogConfig runconfig.LogConfig
|
||||
Mtu int
|
||||
@@ -34,26 +36,57 @@ type CommonConfig struct {
|
||||
TrustKeyPath string
|
||||
}
|
||||
|
||||
// bridgeConfig stores all the bridge driver specific
|
||||
// configuration.
|
||||
type bridgeConfig struct {
|
||||
EnableIPv6 bool
|
||||
EnableIPTables bool
|
||||
EnableIPForward bool
|
||||
EnableIPMasq bool
|
||||
EnableUserlandProxy bool
|
||||
DefaultIP net.IP
|
||||
Iface string
|
||||
IP string
|
||||
FixedCIDR string
|
||||
FixedCIDRv6 string
|
||||
DefaultGatewayIPv4 string
|
||||
DefaultGatewayIPv6 string
|
||||
InterContainerCommunication bool
|
||||
}
|
||||
|
||||
// InstallCommonFlags adds command-line options to the top-level flag parser for
|
||||
// the current process.
|
||||
// Subsequent calls to `flag.Parse` will populate config with values parsed
|
||||
// from the command-line.
|
||||
|
||||
func (config *Config) InstallCommonFlags() {
|
||||
opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options")
|
||||
opts.ListVar(&config.ExecOptions, []string{"-exec-opt"}, "Set exec driver options")
|
||||
flag.StringVar(&config.Pidfile, []string{"p", "-pidfile"}, defaultPidFile, "Path to use for daemon PID file")
|
||||
flag.StringVar(&config.Root, []string{"g", "-graph"}, defaultGraph, "Root of the Docker runtime")
|
||||
flag.StringVar(&config.ExecRoot, []string{"-exec-root"}, "/var/run/docker", "Root of the Docker execdriver")
|
||||
flag.BoolVar(&config.AutoRestart, []string{"#r", "#-restart"}, true, "--restart on the daemon has been deprecated in favor of --restart policies on docker run")
|
||||
flag.BoolVar(&config.Bridge.EnableIPTables, []string{"#iptables", "-iptables"}, true, "Enable addition of iptables rules")
|
||||
flag.BoolVar(&config.Bridge.EnableIPForward, []string{"#ip-forward", "-ip-forward"}, true, "Enable net.ipv4.ip_forward")
|
||||
flag.BoolVar(&config.Bridge.EnableIPMasq, []string{"-ip-masq"}, true, "Enable IP masquerading")
|
||||
flag.BoolVar(&config.Bridge.EnableIPv6, []string{"-ipv6"}, false, "Enable IPv6 networking")
|
||||
flag.StringVar(&config.Bridge.IP, []string{"#bip", "-bip"}, "", "Specify network bridge IP")
|
||||
flag.StringVar(&config.Bridge.Iface, []string{"b", "-bridge"}, "", "Attach containers to a network bridge")
|
||||
flag.StringVar(&config.Bridge.FixedCIDR, []string{"-fixed-cidr"}, "", "IPv4 subnet for fixed IPs")
|
||||
flag.StringVar(&config.Bridge.FixedCIDRv6, []string{"-fixed-cidr-v6"}, "", "IPv6 subnet for fixed IPs")
|
||||
flag.StringVar(&config.Bridge.DefaultGatewayIPv4, []string{"-default-gateway"}, "", "Container default gateway IPv4 address")
|
||||
flag.StringVar(&config.Bridge.DefaultGatewayIPv6, []string{"-default-gateway-v6"}, "", "Container default gateway IPv6 address")
|
||||
flag.BoolVar(&config.Bridge.InterContainerCommunication, []string{"#icc", "-icc"}, true, "Enable inter-container communication")
|
||||
flag.StringVar(&config.GraphDriver, []string{"s", "-storage-driver"}, "", "Storage driver to use")
|
||||
flag.StringVar(&config.ExecDriver, []string{"e", "-exec-driver"}, defaultExec, "Exec driver to use")
|
||||
flag.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, "Set the containers network MTU")
|
||||
flag.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "#-api-enable-cors"}, false, "Enable CORS headers in the remote API, this is deprecated by --api-cors-header")
|
||||
flag.StringVar(&config.CorsHeaders, []string{"-api-cors-header"}, "", "Set CORS headers in the remote API")
|
||||
opts.IPVar(&config.Bridge.DefaultIP, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports")
|
||||
// FIXME: why the inconsistency between "hosts" and "sockets"?
|
||||
opts.IPListVar(&config.Dns, []string{"#dns", "-dns"}, "DNS server to use")
|
||||
opts.DnsSearchListVar(&config.DnsSearch, []string{"-dns-search"}, "DNS search domains to use")
|
||||
opts.LabelListVar(&config.Labels, []string{"-label"}, "Set key=value labels to the daemon")
|
||||
flag.StringVar(&config.LogConfig.Type, []string{"-log-driver"}, "json-file", "Default driver for container logs")
|
||||
opts.LogOptsVar(config.LogConfig.Config, []string{"-log-opt"}, "Set log driver options")
|
||||
flag.BoolVar(&config.Bridge.EnableUserlandProxy, []string{"-userland-proxy"}, true, "Use userland proxy for loopback traffic")
|
||||
|
||||
}
|
||||
|
||||
+4
-36
@@ -1,8 +1,6 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/docker/docker/opts"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/pkg/ulimit"
|
||||
@@ -21,32 +19,13 @@ type Config struct {
|
||||
CommonConfig
|
||||
|
||||
// Fields below here are platform specific.
|
||||
|
||||
// Bridge holds bridge network specific configuration.
|
||||
Bridge bridgeConfig
|
||||
EnableSelinuxSupport bool
|
||||
ExecOptions []string
|
||||
GraphOptions []string
|
||||
SocketGroup string
|
||||
Ulimits map[string]*ulimit.Ulimit
|
||||
}
|
||||
|
||||
// bridgeConfig stores all the bridge driver specific
|
||||
// configuration.
|
||||
type bridgeConfig struct {
|
||||
EnableIPv6 bool
|
||||
EnableIPTables bool
|
||||
EnableIPForward bool
|
||||
EnableIPMasq bool
|
||||
EnableUserlandProxy bool
|
||||
DefaultIP net.IP
|
||||
Iface string
|
||||
IP string
|
||||
FixedCIDR string
|
||||
FixedCIDRv6 string
|
||||
DefaultGatewayIPv4 net.IP
|
||||
DefaultGatewayIPv6 net.IP
|
||||
InterContainerCommunication bool
|
||||
}
|
||||
|
||||
// InstallFlags adds command-line options to the top-level flag parser for
|
||||
// the current process.
|
||||
// Subsequent calls to `flag.Parse` will populate config with values parsed
|
||||
@@ -56,21 +35,10 @@ func (config *Config) InstallFlags() {
|
||||
config.InstallCommonFlags()
|
||||
|
||||
// Then platform-specific install flags
|
||||
opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options")
|
||||
opts.ListVar(&config.ExecOptions, []string{"-exec-opt"}, "Set exec driver options")
|
||||
flag.BoolVar(&config.EnableSelinuxSupport, []string{"-selinux-enabled"}, false, "Enable selinux support")
|
||||
flag.StringVar(&config.SocketGroup, []string{"G", "-group"}, "docker", "Group for the unix socket")
|
||||
config.Ulimits = make(map[string]*ulimit.Ulimit)
|
||||
opts.UlimitMapVar(config.Ulimits, []string{"-default-ulimit"}, "Set default ulimits for containers")
|
||||
flag.BoolVar(&config.Bridge.EnableIPTables, []string{"#iptables", "-iptables"}, true, "Enable addition of iptables rules")
|
||||
flag.BoolVar(&config.Bridge.EnableIPForward, []string{"#ip-forward", "-ip-forward"}, true, "Enable net.ipv4.ip_forward")
|
||||
flag.BoolVar(&config.Bridge.EnableIPMasq, []string{"-ip-masq"}, true, "Enable IP masquerading")
|
||||
flag.BoolVar(&config.Bridge.EnableIPv6, []string{"-ipv6"}, false, "Enable IPv6 networking")
|
||||
flag.StringVar(&config.Bridge.IP, []string{"#bip", "-bip"}, "", "Specify network bridge IP")
|
||||
flag.StringVar(&config.Bridge.Iface, []string{"b", "-bridge"}, "", "Attach containers to a network bridge")
|
||||
flag.StringVar(&config.Bridge.FixedCIDR, []string{"-fixed-cidr"}, "", "IPv4 subnet for fixed IPs")
|
||||
flag.StringVar(&config.Bridge.FixedCIDRv6, []string{"-fixed-cidr-v6"}, "", "IPv6 subnet for fixed IPs")
|
||||
opts.IPVar(&config.Bridge.DefaultGatewayIPv4, []string{"-default-gateway"}, "", "Container default gateway IPv4 address")
|
||||
opts.IPVar(&config.Bridge.DefaultGatewayIPv6, []string{"-default-gateway-v6"}, "", "Container default gateway IPv6 address")
|
||||
flag.BoolVar(&config.Bridge.InterContainerCommunication, []string{"#icc", "-icc"}, true, "Enable inter-container communication")
|
||||
opts.IPVar(&config.Bridge.DefaultIP, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports")
|
||||
flag.BoolVar(&config.Bridge.EnableUserlandProxy, []string{"-userland-proxy"}, true, "Use userland proxy for loopback traffic")
|
||||
}
|
||||
|
||||
+1
-4
@@ -73,10 +73,7 @@ type CommonContainer struct {
|
||||
MountLabel, ProcessLabel string
|
||||
RestartCount int
|
||||
UpdateDns bool
|
||||
|
||||
MountPoints map[string]*mountPoint
|
||||
Volumes map[string]string // Deprecated since 1.7, kept for backwards compatibility
|
||||
VolumesRW map[string]bool // Deprecated since 1.7, kept for backwards compatibility
|
||||
MountPoints map[string]*mountPoint
|
||||
|
||||
hostConfig *runconfig.HostConfig
|
||||
command *execdriver.Command
|
||||
|
||||
@@ -15,10 +15,6 @@ import (
|
||||
)
|
||||
|
||||
func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig) (string, []string, error) {
|
||||
if config == nil {
|
||||
return "", nil, fmt.Errorf("Config cannot be empty in order to create a container")
|
||||
}
|
||||
|
||||
warnings, err := daemon.verifyHostConfig(hostConfig)
|
||||
if err != nil {
|
||||
return "", warnings, err
|
||||
|
||||
+36
-52
@@ -50,6 +50,8 @@ import (
|
||||
"github.com/docker/docker/volume/local"
|
||||
)
|
||||
|
||||
const defaultVolumesPathName = "volumes"
|
||||
|
||||
var (
|
||||
validContainerNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
|
||||
validContainerNamePattern = regexp.MustCompile(`^/?` + validContainerNameChars + `+$`)
|
||||
@@ -156,7 +158,12 @@ func (daemon *Daemon) containerRoot(id string) string {
|
||||
// This is typically done at startup.
|
||||
func (daemon *Daemon) load(id string) (*Container, error) {
|
||||
container := &Container{
|
||||
CommonContainer: daemon.newBaseContainer(id),
|
||||
CommonContainer: CommonContainer{
|
||||
State: NewState(),
|
||||
root: daemon.containerRoot(id),
|
||||
MountPoints: make(map[string]*mountPoint),
|
||||
execCommands: newExecStore(),
|
||||
},
|
||||
}
|
||||
|
||||
if err := container.FromDisk(); err != nil {
|
||||
@@ -519,21 +526,25 @@ func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID
|
||||
daemon.generateHostname(id, config)
|
||||
entrypoint, args := daemon.getEntrypointAndArgs(config.Entrypoint, config.Cmd)
|
||||
|
||||
base := daemon.newBaseContainer(id)
|
||||
base.Created = time.Now().UTC()
|
||||
base.Path = entrypoint
|
||||
base.Args = args //FIXME: de-duplicate from config
|
||||
base.Config = config
|
||||
base.hostConfig = &runconfig.HostConfig{}
|
||||
base.ImageID = imgID
|
||||
base.NetworkSettings = &network.Settings{}
|
||||
base.Name = name
|
||||
base.Driver = daemon.driver.String()
|
||||
base.ExecDriver = daemon.execDriver.Name()
|
||||
|
||||
container := &Container{
|
||||
CommonContainer: base,
|
||||
CommonContainer: CommonContainer{
|
||||
ID: id, // FIXME: we should generate the ID here instead of receiving it as an argument
|
||||
Created: time.Now().UTC(),
|
||||
Path: entrypoint,
|
||||
Args: args, //FIXME: de-duplicate from config
|
||||
Config: config,
|
||||
hostConfig: &runconfig.HostConfig{},
|
||||
ImageID: imgID,
|
||||
NetworkSettings: &network.Settings{},
|
||||
Name: name,
|
||||
Driver: daemon.driver.String(),
|
||||
ExecDriver: daemon.execDriver.Name(),
|
||||
State: NewState(),
|
||||
execCommands: newExecStore(),
|
||||
MountPoints: map[string]*mountPoint{},
|
||||
},
|
||||
}
|
||||
container.root = daemon.containerRoot(container.ID)
|
||||
|
||||
return container, err
|
||||
}
|
||||
@@ -781,7 +792,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
volumesDriver, err := local.New(config.Root)
|
||||
volumesDriver, err := local.New(filepath.Join(config.Root, defaultVolumesPathName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -952,14 +963,6 @@ func initNetworkController(config *Config) (libnetwork.NetworkController, error)
|
||||
netOption["FixedCIDRv6"] = fCIDRv6
|
||||
}
|
||||
|
||||
if config.Bridge.DefaultGatewayIPv4 != nil {
|
||||
netOption["DefaultGatewayIPv4"] = config.Bridge.DefaultGatewayIPv4
|
||||
}
|
||||
|
||||
if config.Bridge.DefaultGatewayIPv6 != nil {
|
||||
netOption["DefaultGatewayIPv6"] = config.Bridge.DefaultGatewayIPv6
|
||||
}
|
||||
|
||||
// --ip processing
|
||||
if config.Bridge.DefaultIP != nil {
|
||||
netOption["DefaultBindingIP"] = config.Bridge.DefaultIP
|
||||
@@ -979,6 +982,16 @@ func initNetworkController(config *Config) (libnetwork.NetworkController, error)
|
||||
}
|
||||
|
||||
func (daemon *Daemon) Shutdown() error {
|
||||
if daemon.containerGraph != nil {
|
||||
if err := daemon.containerGraph.Close(); err != nil {
|
||||
logrus.Errorf("Error during container graph.Close(): %v", err)
|
||||
}
|
||||
}
|
||||
if daemon.driver != nil {
|
||||
if err := daemon.driver.Cleanup(); err != nil {
|
||||
logrus.Errorf("Error during graph storage driver.Cleanup(): %v", err)
|
||||
}
|
||||
}
|
||||
if daemon.containers != nil {
|
||||
group := sync.WaitGroup{}
|
||||
logrus.Debug("starting clean shutdown of all containers...")
|
||||
@@ -1000,23 +1013,6 @@ func (daemon *Daemon) Shutdown() error {
|
||||
}
|
||||
}
|
||||
group.Wait()
|
||||
|
||||
// trigger libnetwork GC only if it's initialized
|
||||
if daemon.netController != nil {
|
||||
daemon.netController.GC()
|
||||
}
|
||||
}
|
||||
|
||||
if daemon.containerGraph != nil {
|
||||
if err := daemon.containerGraph.Close(); err != nil {
|
||||
logrus.Errorf("Error during container graph.Close(): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if daemon.driver != nil {
|
||||
if err := daemon.driver.Cleanup(); err != nil {
|
||||
logrus.Errorf("Error during graph storage driver.Cleanup(): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -1250,15 +1246,3 @@ func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.
|
||||
container.toDisk()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) newBaseContainer(id string) CommonContainer {
|
||||
return CommonContainer{
|
||||
ID: id,
|
||||
State: NewState(),
|
||||
MountPoints: make(map[string]*mountPoint),
|
||||
Volumes: make(map[string]string),
|
||||
VolumesRW: make(map[string]bool),
|
||||
execCommands: newExecStore(),
|
||||
root: daemon.containerRoot(id),
|
||||
}
|
||||
}
|
||||
|
||||
+7
-220
@@ -12,8 +12,6 @@ import (
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
"github.com/docker/docker/pkg/truncindex"
|
||||
"github.com/docker/docker/volume"
|
||||
"github.com/docker/docker/volume/drivers"
|
||||
"github.com/docker/docker/volume/local"
|
||||
)
|
||||
|
||||
//
|
||||
@@ -180,11 +178,10 @@ func TestLoadWithVolume(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
daemon, err := initDaemonForVolumesTest(tmp)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
daemon := &Daemon{
|
||||
repository: tmp,
|
||||
root: tmp,
|
||||
}
|
||||
defer volumedrivers.Unregister(volume.DefaultDriverName)
|
||||
|
||||
c, err := daemon.load(containerId)
|
||||
if err != nil {
|
||||
@@ -217,7 +214,7 @@ func TestLoadWithVolume(t *testing.T) {
|
||||
t.Fatalf("Expected mount driver local, was %s\n", m.Driver)
|
||||
}
|
||||
|
||||
newVolumeContent := filepath.Join(volumePath, local.VolumeDataPathName, "helo")
|
||||
newVolumeContent := filepath.Join(volumePath, "helo")
|
||||
b, err := ioutil.ReadFile(newVolumeContent)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -268,11 +265,10 @@ func TestLoadWithBindMount(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
daemon, err := initDaemonForVolumesTest(tmp)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
daemon := &Daemon{
|
||||
repository: tmp,
|
||||
root: tmp,
|
||||
}
|
||||
defer volumedrivers.Unregister(volume.DefaultDriverName)
|
||||
|
||||
c, err := daemon.load(containerId)
|
||||
if err != nil {
|
||||
@@ -305,212 +301,3 @@ func TestLoadWithBindMount(t *testing.T) {
|
||||
t.Fatalf("Expected mount point to be RW but it was not\n")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadWithVolume17RC(t *testing.T) {
|
||||
tmp, err := ioutil.TempDir("", "docker-daemon-test-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmp)
|
||||
|
||||
containerId := "d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e"
|
||||
containerPath := filepath.Join(tmp, containerId)
|
||||
if err := os.MkdirAll(containerPath, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
hostVolumeId := "6a3c03fc4a4e588561a543cc3bdd50089e27bd11bbb0e551e19bf735e2514101"
|
||||
volumePath := filepath.Join(tmp, "volumes", hostVolumeId)
|
||||
|
||||
if err := os.MkdirAll(volumePath, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
content := filepath.Join(volumePath, "helo")
|
||||
if err := ioutil.WriteFile(content, []byte("HELO"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
config := `{"State":{"Running":true,"Paused":false,"Restarting":false,"OOMKilled":false,"Dead":false,"Pid":2464,"ExitCode":0,
|
||||
"Error":"","StartedAt":"2015-05-26T16:48:53.869308965Z","FinishedAt":"0001-01-01T00:00:00Z"},
|
||||
"ID":"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e","Created":"2015-05-26T16:48:53.7987917Z","Path":"top",
|
||||
"Args":[],"Config":{"Hostname":"d59df5276e7b","Domainname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"Cpuset":"",
|
||||
"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"ExposedPorts":null,"Tty":true,"OpenStdin":true,
|
||||
"StdinOnce":false,"Env":null,"Cmd":["top"],"Image":"ubuntu:latest","Volumes":null,"WorkingDir":"","Entrypoint":null,
|
||||
"NetworkDisabled":false,"MacAddress":"","OnBuild":null,"Labels":{}},"Image":"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95",
|
||||
"NetworkSettings":{"IPAddress":"172.17.0.1","IPPrefixLen":16,"MacAddress":"02:42:ac:11:00:01","LinkLocalIPv6Address":"fe80::42:acff:fe11:1",
|
||||
"LinkLocalIPv6PrefixLen":64,"GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"Gateway":"172.17.42.1","IPv6Gateway":"","Bridge":"docker0","PortMapping":null,"Ports":{}},
|
||||
"ResolvConfPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf",
|
||||
"HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname",
|
||||
"HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts",
|
||||
"LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log",
|
||||
"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0,
|
||||
"UpdateDns":false,"MountPoints":{"/vol1":{"Name":"6a3c03fc4a4e588561a543cc3bdd50089e27bd11bbb0e551e19bf735e2514101","Destination":"/vol1","Driver":"local","RW":true,"Source":"","Relabel":""}},"AppliedVolumesFrom":null}`
|
||||
|
||||
if err = ioutil.WriteFile(filepath.Join(containerPath, "config.json"), []byte(config), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
hostConfig := `{"Binds":[],"ContainerIDFile":"","LxcConf":[],"Memory":0,"MemorySwap":0,"CpuShares":0,"CpusetCpus":"",
|
||||
"Privileged":false,"PortBindings":{},"Links":null,"PublishAllPorts":false,"Dns":null,"DnsSearch":null,"ExtraHosts":null,"VolumesFrom":null,
|
||||
"Devices":[],"NetworkMode":"bridge","IpcMode":"","PidMode":"","CapAdd":null,"CapDrop":null,"RestartPolicy":{"Name":"no","MaximumRetryCount":0},
|
||||
"SecurityOpt":null,"ReadonlyRootfs":false,"Ulimits":null,"LogConfig":{"Type":"","Config":null},"CgroupParent":""}`
|
||||
if err = ioutil.WriteFile(filepath.Join(containerPath, "hostconfig.json"), []byte(hostConfig), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
daemon, err := initDaemonForVolumesTest(tmp)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer volumedrivers.Unregister(volume.DefaultDriverName)
|
||||
|
||||
c, err := daemon.load(containerId)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = daemon.verifyVolumesInfo(c)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if len(c.MountPoints) != 1 {
|
||||
t.Fatalf("Expected 1 volume mounted, was 0\n")
|
||||
}
|
||||
|
||||
m := c.MountPoints["/vol1"]
|
||||
if m.Name != hostVolumeId {
|
||||
t.Fatalf("Expected mount name to be %s, was %s\n", hostVolumeId, m.Name)
|
||||
}
|
||||
|
||||
if m.Destination != "/vol1" {
|
||||
t.Fatalf("Expected mount destination /vol1, was %s\n", m.Destination)
|
||||
}
|
||||
|
||||
if !m.RW {
|
||||
t.Fatalf("Expected mount point to be RW but it was not\n")
|
||||
}
|
||||
|
||||
if m.Driver != volume.DefaultDriverName {
|
||||
t.Fatalf("Expected mount driver local, was %s\n", m.Driver)
|
||||
}
|
||||
|
||||
newVolumeContent := filepath.Join(volumePath, local.VolumeDataPathName, "helo")
|
||||
b, err := ioutil.ReadFile(newVolumeContent)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(b) != "HELO" {
|
||||
t.Fatalf("Expected HELO, was %s\n", string(b))
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveLocalVolumesFollowingSymlinks(t *testing.T) {
|
||||
tmp, err := ioutil.TempDir("", "docker-daemon-test-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmp)
|
||||
|
||||
containerId := "d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e"
|
||||
containerPath := filepath.Join(tmp, containerId)
|
||||
if err := os.MkdirAll(containerPath, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
hostVolumeId := stringid.GenerateRandomID()
|
||||
vfsPath := filepath.Join(tmp, "vfs", "dir", hostVolumeId)
|
||||
volumePath := filepath.Join(tmp, "volumes", hostVolumeId)
|
||||
|
||||
if err := os.MkdirAll(vfsPath, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.MkdirAll(volumePath, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
content := filepath.Join(vfsPath, "helo")
|
||||
if err := ioutil.WriteFile(content, []byte("HELO"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
config := `{"State":{"Running":true,"Paused":false,"Restarting":false,"OOMKilled":false,"Dead":false,"Pid":2464,"ExitCode":0,
|
||||
"Error":"","StartedAt":"2015-05-26T16:48:53.869308965Z","FinishedAt":"0001-01-01T00:00:00Z"},
|
||||
"ID":"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e","Created":"2015-05-26T16:48:53.7987917Z","Path":"top",
|
||||
"Args":[],"Config":{"Hostname":"d59df5276e7b","Domainname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"Cpuset":"",
|
||||
"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"ExposedPorts":null,"Tty":true,"OpenStdin":true,
|
||||
"StdinOnce":false,"Env":null,"Cmd":["top"],"Image":"ubuntu:latest","Volumes":null,"WorkingDir":"","Entrypoint":null,
|
||||
"NetworkDisabled":false,"MacAddress":"","OnBuild":null,"Labels":{}},"Image":"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95",
|
||||
"NetworkSettings":{"IPAddress":"172.17.0.1","IPPrefixLen":16,"MacAddress":"02:42:ac:11:00:01","LinkLocalIPv6Address":"fe80::42:acff:fe11:1",
|
||||
"LinkLocalIPv6PrefixLen":64,"GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"Gateway":"172.17.42.1","IPv6Gateway":"","Bridge":"docker0","PortMapping":null,"Ports":{}},
|
||||
"ResolvConfPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf",
|
||||
"HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname",
|
||||
"HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts",
|
||||
"LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log",
|
||||
"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0,
|
||||
"UpdateDns":false,"Volumes":{"/vol1":"%s"},"VolumesRW":{"/vol1":true},"AppliedVolumesFrom":null}`
|
||||
|
||||
cfg := fmt.Sprintf(config, vfsPath)
|
||||
if err = ioutil.WriteFile(filepath.Join(containerPath, "config.json"), []byte(cfg), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
hostConfig := `{"Binds":[],"ContainerIDFile":"","LxcConf":[],"Memory":0,"MemorySwap":0,"CpuShares":0,"CpusetCpus":"",
|
||||
"Privileged":false,"PortBindings":{},"Links":null,"PublishAllPorts":false,"Dns":null,"DnsSearch":null,"ExtraHosts":null,"VolumesFrom":null,
|
||||
"Devices":[],"NetworkMode":"bridge","IpcMode":"","PidMode":"","CapAdd":null,"CapDrop":null,"RestartPolicy":{"Name":"no","MaximumRetryCount":0},
|
||||
"SecurityOpt":null,"ReadonlyRootfs":false,"Ulimits":null,"LogConfig":{"Type":"","Config":null},"CgroupParent":""}`
|
||||
if err = ioutil.WriteFile(filepath.Join(containerPath, "hostconfig.json"), []byte(hostConfig), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
daemon, err := initDaemonForVolumesTest(tmp)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer volumedrivers.Unregister(volume.DefaultDriverName)
|
||||
|
||||
c, err := daemon.load(containerId)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = daemon.verifyVolumesInfo(c)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if len(c.MountPoints) != 1 {
|
||||
t.Fatalf("Expected 1 volume mounted, was 0\n")
|
||||
}
|
||||
|
||||
m := c.MountPoints["/vol1"]
|
||||
v, err := createVolume(m.Name, m.Driver)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := removeVolume(v); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fi, err := os.Stat(vfsPath)
|
||||
if err == nil || !os.IsNotExist(err) {
|
||||
t.Fatalf("Expected vfs path to not exist: %v - %v\n", fi, err)
|
||||
}
|
||||
}
|
||||
|
||||
func initDaemonForVolumesTest(tmp string) (*Daemon, error) {
|
||||
daemon := &Daemon{
|
||||
repository: tmp,
|
||||
root: tmp,
|
||||
}
|
||||
|
||||
volumesDriver, err := local.New(tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
volumedrivers.Register(volumesDriver, volumesDriver.Name())
|
||||
|
||||
return daemon, nil
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ func InitContainer(c *Command) *configs.Config {
|
||||
container.Devices = c.AutoCreatedDevices
|
||||
container.Rootfs = c.Rootfs
|
||||
container.Readonlyfs = c.ReadonlyRootfs
|
||||
container.Privatefs = true
|
||||
|
||||
// check to see if we are running in ramdisk to disable pivot root
|
||||
container.NoPivotRoot = os.Getenv("DOCKER_RAMDISK") != ""
|
||||
|
||||
@@ -124,7 +124,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
||||
dataPath = d.containerDir(c.ID)
|
||||
)
|
||||
|
||||
if c.Network == nil || (c.Network.NamespacePath == "" && c.Network.ContainerID == "") {
|
||||
if c.Network.NamespacePath == "" && c.Network.ContainerID == "" {
|
||||
return execdriver.ExitStatus{ExitCode: -1}, fmt.Errorf("empty namespace path for non-container network")
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/docker/docker/daemon/graphdriver"
|
||||
"github.com/docker/docker/pkg/mount"
|
||||
"github.com/docker/docker/pkg/parsers"
|
||||
"github.com/docker/libcontainer/label"
|
||||
zfs "github.com/mistifyio/go-zfs"
|
||||
)
|
||||
|
||||
@@ -282,15 +281,14 @@ func (d *Driver) Remove(id string) error {
|
||||
func (d *Driver) Get(id, mountLabel string) (string, error) {
|
||||
mountpoint := d.MountPath(id)
|
||||
filesystem := d.ZfsPath(id)
|
||||
options := label.FormatMountLabel("", mountLabel)
|
||||
log.Debugf(`[zfs] mount("%s", "%s", "%s")`, filesystem, mountpoint, options)
|
||||
log.Debugf(`[zfs] mount("%s", "%s", "%s")`, filesystem, mountpoint, mountLabel)
|
||||
|
||||
// Create the target directories if they don't exist
|
||||
if err := os.MkdirAll(mountpoint, 0755); err != nil && !os.IsExist(err) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
err := mount.Mount(filesystem, mountpoint, "zfs", options)
|
||||
err := mount.Mount(filesystem, mountpoint, "zfs", mountLabel)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error creating zfs mount of %s to %s: %v", filesystem, mountpoint, err)
|
||||
}
|
||||
|
||||
+16
-24
@@ -15,39 +15,31 @@ func (daemon *Daemon) ContainerStats(name string, stream bool, out io.Writer) er
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var preCpuStats types.CpuStats
|
||||
getStat := func(v interface{}) *types.Stats {
|
||||
var pre_cpu_stats types.CpuStats
|
||||
for first_v := range updates {
|
||||
first_update := first_v.(*execdriver.ResourceStats)
|
||||
first_stats := convertToAPITypes(first_update.Stats)
|
||||
pre_cpu_stats = first_stats.CpuStats
|
||||
pre_cpu_stats.SystemUsage = first_update.SystemUsage
|
||||
break
|
||||
}
|
||||
enc := json.NewEncoder(out)
|
||||
for v := range updates {
|
||||
update := v.(*execdriver.ResourceStats)
|
||||
ss := convertToAPITypes(update.Stats)
|
||||
ss.PreCpuStats = preCpuStats
|
||||
ss.PreCpuStats = pre_cpu_stats
|
||||
ss.MemoryStats.Limit = uint64(update.MemoryLimit)
|
||||
ss.Read = update.Read
|
||||
ss.CpuStats.SystemUsage = update.SystemUsage
|
||||
preCpuStats = ss.CpuStats
|
||||
return ss
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(out)
|
||||
|
||||
if !stream {
|
||||
// prime the cpu stats so they aren't 0 in the final output
|
||||
s := getStat(<-updates)
|
||||
|
||||
// now pull stats again with the cpu stats primed
|
||||
s = getStat(<-updates)
|
||||
err := enc.Encode(s)
|
||||
daemon.UnsubscribeToContainerStats(name, updates)
|
||||
return err
|
||||
}
|
||||
|
||||
for v := range updates {
|
||||
s := getStat(v)
|
||||
if err := enc.Encode(s); err != nil {
|
||||
pre_cpu_stats = ss.CpuStats
|
||||
if err := enc.Encode(ss); err != nil {
|
||||
// TODO: handle the specific broken pipe
|
||||
daemon.UnsubscribeToContainerStats(name, updates)
|
||||
return err
|
||||
}
|
||||
if !stream {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
+67
-79
@@ -1,6 +1,7 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -11,7 +12,6 @@ import (
|
||||
"github.com/docker/docker/pkg/chrootarchive"
|
||||
"github.com/docker/docker/runconfig"
|
||||
"github.com/docker/docker/volume"
|
||||
"github.com/docker/docker/volume/local"
|
||||
"github.com/docker/libcontainer/label"
|
||||
)
|
||||
|
||||
@@ -53,13 +53,6 @@ func (m *mountPoint) Path() string {
|
||||
return m.Source
|
||||
}
|
||||
|
||||
// BackwardsCompatible decides whether this mount point can be
|
||||
// used in old versions of Docker or not.
|
||||
// Only bind mounts and local volumes can be used in old versions of Docker.
|
||||
func (m *mountPoint) BackwardsCompatible() bool {
|
||||
return len(m.Source) > 0 || m.Driver == volume.DefaultDriverName
|
||||
}
|
||||
|
||||
func parseBindMount(spec string, mountLabel string, config *runconfig.Config) (*mountPoint, error) {
|
||||
bind := &mountPoint{
|
||||
RW: true,
|
||||
@@ -239,20 +232,8 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc
|
||||
mountPoints[bind.Destination] = bind
|
||||
}
|
||||
|
||||
// Keep backwards compatible structures
|
||||
bcVolumes := map[string]string{}
|
||||
bcVolumesRW := map[string]bool{}
|
||||
for _, m := range mountPoints {
|
||||
if m.BackwardsCompatible() {
|
||||
bcVolumes[m.Destination] = m.Path()
|
||||
bcVolumesRW[m.Destination] = m.RW
|
||||
}
|
||||
}
|
||||
|
||||
container.Lock()
|
||||
container.MountPoints = mountPoints
|
||||
container.Volumes = bcVolumes
|
||||
container.VolumesRW = bcVolumesRW
|
||||
container.Unlock()
|
||||
|
||||
return nil
|
||||
@@ -261,74 +242,81 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc
|
||||
// verifyVolumesInfo ports volumes configured for the containers pre docker 1.7.
|
||||
// It reads the container configuration and creates valid mount points for the old volumes.
|
||||
func (daemon *Daemon) verifyVolumesInfo(container *Container) error {
|
||||
// Inspect old structures only when we're upgrading from old versions
|
||||
// to versions >= 1.7 and the MountPoints has not been populated with volumes data.
|
||||
if len(container.MountPoints) == 0 && len(container.Volumes) > 0 {
|
||||
for destination, hostPath := range container.Volumes {
|
||||
vfsPath := filepath.Join(daemon.root, "vfs", "dir")
|
||||
rw := container.VolumesRW != nil && container.VolumesRW[destination]
|
||||
|
||||
if strings.HasPrefix(hostPath, vfsPath) {
|
||||
id := filepath.Base(hostPath)
|
||||
if err := migrateVolume(id, hostPath); err != nil {
|
||||
return err
|
||||
}
|
||||
container.addLocalMountPoint(id, destination, rw)
|
||||
} else { // Bind mount
|
||||
id, source, err := parseVolumeSource(hostPath)
|
||||
// We should not find an error here coming
|
||||
// from the old configuration, but who knows.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
container.addBindMountPoint(id, source, destination, rw)
|
||||
}
|
||||
}
|
||||
} else if len(container.MountPoints) > 0 {
|
||||
// Volumes created with a Docker version >= 1.7. We verify integrity in case of data created
|
||||
// with Docker 1.7 RC versions that put the information in
|
||||
// DOCKER_ROOT/volumes/VOLUME_ID rather than DOCKER_ROOT/volumes/VOLUME_ID/_container_data.
|
||||
l, err := getVolumeDriver(volume.DefaultDriverName)
|
||||
if err != nil {
|
||||
return err
|
||||
jsonPath, err := container.jsonPath()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f, err := os.Open(jsonPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
for _, m := range container.MountPoints {
|
||||
if m.Driver != volume.DefaultDriverName {
|
||||
continue
|
||||
}
|
||||
dataPath := l.(*local.Root).DataPath(m.Name)
|
||||
volumePath := filepath.Dir(dataPath)
|
||||
type oldContVolCfg struct {
|
||||
Volumes map[string]string
|
||||
VolumesRW map[string]bool
|
||||
}
|
||||
|
||||
d, err := ioutil.ReadDir(volumePath)
|
||||
if err != nil {
|
||||
// If the volume directory doesn't exist yet it will be recreated,
|
||||
// so we only return the error when there is a different issue.
|
||||
if !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
// Do not check when the volume directory does not exist.
|
||||
continue
|
||||
}
|
||||
if validVolumeLayout(d) {
|
||||
continue
|
||||
}
|
||||
vols := oldContVolCfg{
|
||||
Volumes: make(map[string]string),
|
||||
VolumesRW: make(map[string]bool),
|
||||
}
|
||||
if err := json.NewDecoder(f).Decode(&vols); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := os.Mkdir(dataPath, 0755); err != nil {
|
||||
for destination, hostPath := range vols.Volumes {
|
||||
vfsPath := filepath.Join(daemon.root, "vfs", "dir")
|
||||
rw := vols.VolumesRW != nil && vols.VolumesRW[destination]
|
||||
|
||||
if strings.HasPrefix(hostPath, vfsPath) {
|
||||
id := filepath.Base(hostPath)
|
||||
if err := daemon.migrateVolume(id, hostPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Move data inside the data directory
|
||||
for _, f := range d {
|
||||
oldp := filepath.Join(volumePath, f.Name())
|
||||
newp := filepath.Join(dataPath, f.Name())
|
||||
if err := os.Rename(oldp, newp); err != nil {
|
||||
logrus.Errorf("Unable to move %s to %s\n", oldp, newp)
|
||||
}
|
||||
container.addLocalMountPoint(id, destination, rw)
|
||||
} else { // Bind mount
|
||||
id, source, err := parseVolumeSource(hostPath)
|
||||
// We should not find an error here coming
|
||||
// from the old configuration, but who knows.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
container.addBindMountPoint(id, source, destination, rw)
|
||||
}
|
||||
}
|
||||
|
||||
return container.ToDisk()
|
||||
return container.ToDisk()
|
||||
}
|
||||
|
||||
// migrateVolume moves the contents of a volume created pre Docker 1.7
|
||||
// to the location expected by the local driver. Steps:
|
||||
// 1. Save old directory that includes old volume's config json file.
|
||||
// 2. Move virtual directory with content to where the local driver expects it to be.
|
||||
// 3. Remove the backup of the old volume config.
|
||||
func (daemon *Daemon) migrateVolume(id, vfs string) error {
|
||||
volumeInfo := filepath.Join(daemon.root, defaultVolumesPathName, id)
|
||||
backup := filepath.Join(daemon.root, defaultVolumesPathName, id+".back")
|
||||
|
||||
var err error
|
||||
if err = os.Rename(volumeInfo, backup); err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
// Put old configuration back in place in case one of the next steps fails.
|
||||
if err != nil {
|
||||
os.Rename(backup, volumeInfo)
|
||||
}
|
||||
}()
|
||||
|
||||
if err = os.Rename(vfs, volumeInfo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = os.RemoveAll(backup); err != nil {
|
||||
logrus.Errorf("Unable to remove volume info backup directory %s: %v", backup, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
|
||||
"github.com/docker/docker/daemon/execdriver"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
"github.com/docker/docker/volume"
|
||||
"github.com/docker/docker/volume/local"
|
||||
)
|
||||
|
||||
// copyOwnership copies the permissions and uid:gid of the source file
|
||||
@@ -70,50 +68,3 @@ func (m mounts) Swap(i, j int) {
|
||||
func (m mounts) parts(i int) int {
|
||||
return len(strings.Split(filepath.Clean(m[i].Destination), string(os.PathSeparator)))
|
||||
}
|
||||
|
||||
// migrateVolume links the contents of a volume created pre Docker 1.7
|
||||
// into the location expected by the local driver.
|
||||
// It creates a symlink from DOCKER_ROOT/vfs/dir/VOLUME_ID to DOCKER_ROOT/volumes/VOLUME_ID/_container_data.
|
||||
// It preserves the volume json configuration generated pre Docker 1.7 to be able to
|
||||
// downgrade from Docker 1.7 to Docker 1.6 without losing volume compatibility.
|
||||
func migrateVolume(id, vfs string) error {
|
||||
l, err := getVolumeDriver(volume.DefaultDriverName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
newDataPath := l.(*local.Root).DataPath(id)
|
||||
fi, err := os.Stat(newDataPath)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
if fi != nil && fi.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return os.Symlink(vfs, newDataPath)
|
||||
}
|
||||
|
||||
// validVolumeLayout checks whether the volume directory layout
|
||||
// is valid to work with Docker post 1.7 or not.
|
||||
func validVolumeLayout(files []os.FileInfo) bool {
|
||||
if len(files) == 1 && files[0].Name() == local.VolumeDataPathName && files[0].IsDir() {
|
||||
return true
|
||||
}
|
||||
|
||||
if len(files) != 2 {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, f := range files {
|
||||
if f.Name() == "config.json" ||
|
||||
(f.Name() == local.VolumeDataPathName && f.Mode()&os.ModeSymlink == os.ModeSymlink) {
|
||||
// Old volume configuration, we ignore it
|
||||
continue
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker/daemon/execdriver"
|
||||
)
|
||||
import "github.com/docker/docker/daemon/execdriver"
|
||||
|
||||
// Not supported on Windows
|
||||
func copyOwnership(source, destination string) error {
|
||||
@@ -16,11 +12,3 @@ func copyOwnership(source, destination string) error {
|
||||
func (container *Container) setupMounts() ([]execdriver.Mount, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func migrateVolume(id, vfs string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validVolumeLayout(files []os.FileInfo) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
# generated by man/man/md2man-all.sh
|
||||
man1/
|
||||
man5/
|
||||
# avoid commiting the awsconfig file used for releases
|
||||
awsconfig
|
||||
|
||||
+17
-4
@@ -280,11 +280,24 @@ aws cloudfront create-invalidation --profile docs.docker.com --distribution-id
|
||||
aws cloudfront create-invalidation --profile docs.docker.com --distribution-id $DISTRIBUTION_ID --invalidation-batch '{"Paths":{"Quantity":1, "Items":["/v1.1/reference/api/docker_io_oauth_api/"]},"CallerReference":"6Mar2015sventest1"}'
|
||||
```
|
||||
|
||||
### Generate the man pages
|
||||
### Generate the man pages for Mac OSX
|
||||
|
||||
For information on generating man pages (short for manual page), see [the man
|
||||
page directory](https://github.com/docker/docker/tree/master/docker) in this
|
||||
project.
|
||||
When using Docker on Mac OSX the man pages will be missing by default. You can manually generate them by following these steps:
|
||||
|
||||
1. Checkout the docker source. You must clone into your `/Users` directory because Boot2Docker can only share this path
|
||||
with the docker containers.
|
||||
|
||||
$ git clone https://github.com/docker/docker.git
|
||||
|
||||
2. Build the docker image.
|
||||
|
||||
$ cd docker/docs/man
|
||||
$ docker build -t docker/md2man .
|
||||
|
||||
3. Build the man pages.
|
||||
|
||||
$ docker run -v /Users/<path-to-git-dir>/docker/docs/man:/docs:rw -w /docs -i docker/md2man /docs/md2man-all.sh
|
||||
|
||||
4. Copy the generated man pages to `/usr/share/man`
|
||||
|
||||
$ cp -R man* /usr/share/man/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM golang:1.4
|
||||
FROM golang:1.3
|
||||
RUN mkdir -p /go/src/github.com/cpuguy83
|
||||
RUN mkdir -p /go/src/github.com/cpuguy83 \
|
||||
&& git clone -b v1.0.1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
|
||||
&& git clone -b v1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
|
||||
&& cd /go/src/github.com/cpuguy83/go-md2man \
|
||||
&& go get -v ./...
|
||||
CMD ["/go/bin/go-md2man", "--help"]
|
||||
@@ -196,7 +196,7 @@ A Dockerfile is similar to a Makefile.
|
||||
ADD <src> <dest>
|
||||
|
||||
# Required for paths with whitespace
|
||||
ADD ["<src>",... "<dest>"]
|
||||
ADD ["<src>", "<dest>"]
|
||||
```
|
||||
|
||||
The **ADD** instruction copies new files, directories
|
||||
@@ -215,7 +215,7 @@ A Dockerfile is similar to a Makefile.
|
||||
COPY <src> <dest>
|
||||
|
||||
# Required for paths with whitespace
|
||||
COPY ["<src>",... "<dest>"]
|
||||
COPY ["<src>", "<dest>"]
|
||||
```
|
||||
|
||||
The **COPY** instruction copies new files from `<src>` and
|
||||
@@ -0,0 +1,33 @@
|
||||
Docker Documentation
|
||||
====================
|
||||
|
||||
This directory contains the Docker user manual in the Markdown format.
|
||||
Do *not* edit the man pages in the man1 directory. Instead, amend the
|
||||
Markdown (*.md) files.
|
||||
|
||||
# Generating man pages from the Markdown files
|
||||
|
||||
The recommended approach for generating the man pages is via a Docker
|
||||
container using the supplied `Dockerfile` to create an image with the correct
|
||||
environment. This uses `go-md2man`, a pure Go Markdown to man page generator.
|
||||
|
||||
## Building the md2man image
|
||||
|
||||
There is a `Dockerfile` provided in the `docker/docs/man` directory.
|
||||
|
||||
Using this `Dockerfile`, create a Docker image tagged `docker/md2man`:
|
||||
|
||||
docker build -t docker/md2man .
|
||||
|
||||
## Utilizing the image
|
||||
|
||||
Once the image is built, run a container using the image with *volumes*:
|
||||
|
||||
docker run -v /<path-to-git-dir>/docker/docs/man:/docs:rw \
|
||||
-w /docs -i docker/md2man /docs/md2man-all.sh
|
||||
|
||||
The `md2man` Docker container will process the Markdown files and generate
|
||||
the man pages inside the `docker/docs/man/man1` directory using
|
||||
Docker volumes. For more information on Docker volumes see the man page for
|
||||
`docker run` and also look at the article [Sharing Directories via Volumes]
|
||||
(https://docs.docker.com/use/working_with_volumes/).
|
||||
@@ -63,12 +63,7 @@ Again the output container IDs have been shortened for the purposes of this docu
|
||||
2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die
|
||||
2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop
|
||||
|
||||
|
||||
If you do not provide the --since option, the command returns only new and/or
|
||||
live events.
|
||||
|
||||
# HISTORY
|
||||
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
|
||||
based on docker.com source material and internal work.
|
||||
June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
|
||||
June 2015, updated by Brian Goff <cpuguy83@gmail.com>
|
||||
+6
-1
@@ -1,5 +1,5 @@
|
||||
site_name: Docker Documentation
|
||||
#site_url: https://docs.docker.com/
|
||||
#site_url: http://docs.docker.com/
|
||||
site_url: /
|
||||
site_description: Documentation for fast and lightweight Docker container based virtualization framework.
|
||||
site_favicon: img/favicon.png
|
||||
@@ -27,6 +27,11 @@ pages:
|
||||
- ['index.md', 'About', 'Docker']
|
||||
- ['introduction/understanding-docker.md', 'About', 'Understanding Docker']
|
||||
- ['release-notes.md', 'About', 'Release notes']
|
||||
# Experimental
|
||||
- ['experimental/experimental.md', 'About', 'Experimental Features']
|
||||
- ['experimental/plugin_api.md', '**HIDDEN**']
|
||||
- ['experimental/plugins_volume.md', '**HIDDEN**']
|
||||
- ['experimental/plugins.md', '**HIDDEN**']
|
||||
- ['reference/glossary.md', 'About', 'Glossary']
|
||||
- ['introduction/index.md', '**HIDDEN**']
|
||||
|
||||
|
||||
@@ -24,28 +24,14 @@ If you want Docker to start at boot, you should also:
|
||||
## Custom Docker daemon options
|
||||
|
||||
There are a number of ways to configure the daemon flags and environment variables
|
||||
for your Docker daemon.
|
||||
for your Docker daemon.
|
||||
|
||||
If the `docker.service` file is set to use an `EnvironmentFile`
|
||||
(often pointing to `/etc/sysconfig/docker`) then you can modify the
|
||||
referenced file.
|
||||
|
||||
Check if the `docker.service` uses an `EnvironmentFile`:
|
||||
|
||||
$ sudo systemctl show docker | grep EnvironmentFile
|
||||
EnvironmentFile=-/etc/sysconfig/docker (ignore_errors=yes)
|
||||
|
||||
Alternatively, find out where the service file is located, and look for the
|
||||
property:
|
||||
|
||||
$ sudo systemctl status docker | grep Loaded
|
||||
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
|
||||
$ sudo grep EnvironmentFile /usr/lib/systemd/system/docker.service
|
||||
EnvironmentFile=-/etc/sysconfig/docker
|
||||
|
||||
You can customize the Docker daemon options using override files as explained in the
|
||||
[HTTP Proxy example](#http-proxy) below. The files located in `/usr/lib/systemd/system`
|
||||
or `/lib/systemd/system` contain the default options and should not be edited.
|
||||
Or, you may need to edit the `docker.service` file, which can be in
|
||||
`/usr/lib/systemd/system`, `/etc/systemd/service`, or `/lib/systemd/system`.
|
||||
|
||||
### Runtime directory and storage driver
|
||||
|
||||
@@ -56,7 +42,7 @@ In this example, we'll assume that your `docker.service` file looks something li
|
||||
|
||||
[Unit]
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=https://docs.docker.com
|
||||
Documentation=http://docs.docker.com
|
||||
After=network.target docker.socket
|
||||
Requires=docker.socket
|
||||
|
||||
@@ -104,11 +90,6 @@ Flush changes:
|
||||
|
||||
$ sudo systemctl daemon-reload
|
||||
|
||||
Verify that the configuration has been loaded:
|
||||
|
||||
$ sudo systemctl show docker --property Environment
|
||||
Environment=HTTP_PROXY=http://proxy.example.com:80/
|
||||
|
||||
Restart Docker:
|
||||
|
||||
$ sudo systemctl restart docker
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Admin guide
|
||||
page_description: Documentation describing administration of Docker Hub Enterprise
|
||||
page_keywords: docker, documentation, about, technology, hub, enterprise
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Configuration options
|
||||
page_description: Configuration instructions for Docker Hub Enterprise
|
||||
page_keywords: docker, documentation, about, technology, understanding, enterprise, hub, registry
|
||||
@@ -137,11 +136,11 @@ Continue by following the steps corresponding to your chosen OS.
|
||||
|
||||
```
|
||||
$ export DOMAIN_NAME=dhe.yourdomain.com
|
||||
$ openssl s_client -connect $DOMAIN_NAME:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /usr/local/share/ca-certificates/$DOMAIN_NAME.crt
|
||||
$ sudo update-ca-certificates
|
||||
$ openssl s_client -connect $DOMAIN_NAME:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM | tee /usr/local/share/ca-certificates/$DOMAIN_NAME.crt
|
||||
$ update-ca-certificates
|
||||
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
|
||||
Running hooks in /etc/ca-certificates/update.d....done.
|
||||
$ sudo service docker restart
|
||||
$ service docker restart
|
||||
docker stop/waiting
|
||||
docker start/running, process 29291
|
||||
```
|
||||
@@ -150,9 +149,9 @@ Continue by following the steps corresponding to your chosen OS.
|
||||
|
||||
```
|
||||
$ export DOMAIN_NAME=dhe.yourdomain.com
|
||||
$ openssl s_client -connect $DOMAIN_NAME:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /etc/pki/ca-trust/source/anchors/$DOMAIN_NAME.crt
|
||||
$ sudo update-ca-trust
|
||||
$ sudo /bin/systemctl restart docker.service
|
||||
$ openssl s_client -connect $DOMAIN_NAME:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM | tee /etc/pki/ca-trust/source/anchors/$DOMAIN_NAME.crt
|
||||
$ update-ca-trust
|
||||
$ /bin/systemctl restart docker.service
|
||||
```
|
||||
|
||||
#### Boot2Docker 1.6.0
|
||||
@@ -258,7 +257,7 @@ API.
|
||||
* *Yaml configuration file*: This file (`/usr/local/etc/dhe/storage.yml`) is
|
||||
used to configure the image storage services. The editable text of the file is
|
||||
displayed in the dialog box. The schema of this file is identical to that used
|
||||
by the [Registry 2.0](https://docs.docker.com/registry/configuration/).
|
||||
by the [Registry 2.0](http://docs.docker.com/registry/configuration/).
|
||||
* If you are using the file system driver to provide local image storage, you will need to specify a root directory which will get mounted as a sub-path of
|
||||
`/var/local/dhe/image-storage`. The default value of this root directory is
|
||||
`/local`, so the full path to it is `/var/local/dhe/image-storage/local`.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Overview
|
||||
page_description: Docker Hub Enterprise
|
||||
page_keywords: docker, documentation, about, technology, understanding, enterprise, hub, registry
|
||||
@@ -32,12 +31,6 @@ DHE is perfect for:
|
||||
|
||||
DHE is built on [version 2 of the Docker registry](https://github.com/docker/distribution).
|
||||
|
||||
> **Note:** This initial release of DHE has limited access. To get access,
|
||||
> you will need an account on [Docker Hub](https://hub.docker.com/). Once you're
|
||||
> logged in to the Hub with your account, visit the
|
||||
> [early access registration page](https://registry.hub.docker.com/earlyaccess/)
|
||||
> and follow the steps there to get signed up.
|
||||
|
||||
## Available Documentation
|
||||
|
||||
The following documentation for DHE is available:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Install
|
||||
page_description: Installation instructions for Docker Hub Enterprise
|
||||
page_keywords: docker, documentation, about, technology, understanding, enterprise, hub, registry
|
||||
@@ -21,12 +20,6 @@ Specifically, installation requires completion of these steps, in order:
|
||||
3. Install DHE
|
||||
4. Add your license to your DHE instance
|
||||
|
||||
> **Note:** This initial release of DHE has limited access. To get access,
|
||||
> you will need an account on [Docker Hub](https://hub.docker.com/). Once you're
|
||||
> logged in to the Hub with your account, visit the
|
||||
> [early access registration page](https://registry.hub.docker.com/earlyaccess/)
|
||||
> and follow the steps there to get signed up.
|
||||
|
||||
## Licensing
|
||||
|
||||
In order to run DHE, you will need to acquire a license, either by purchasing
|
||||
@@ -115,8 +108,6 @@ following to install commercially supported Docker Engine and its dependencies:
|
||||
|
||||
```
|
||||
$ sudo apt-get update && sudo apt-get upgrade
|
||||
$ sudo apt-get install -y linux-image-extra-virtual
|
||||
$ sudo reboot
|
||||
$ chmod 755 docker-cs-engine-deb.sh
|
||||
$ sudo ./docker-cs-engine-deb.sh
|
||||
$ sudo apt-get install docker-engine-cs
|
||||
@@ -148,25 +139,19 @@ so upgrading the Engine only requires you to run the update commands on your ser
|
||||
|
||||
### RHEL 7.0/7.1 upgrade
|
||||
|
||||
The following commands will stop the running DHE, upgrade CS Docker Engine,
|
||||
and then start DHE again:
|
||||
To upgrade CS Docker Engine, run the following command:
|
||||
|
||||
```
|
||||
$ sudo bash -c "$(sudo docker run dockerhubenterprise/manager stop)"
|
||||
$ sudo yum update
|
||||
$ sudo systemctl daemon-reload && sudo systemctl restart docker
|
||||
$ sudo bash -c "$(sudo docker run dockerhubenterprise/manager start)"
|
||||
```
|
||||
|
||||
### Ubuntu 14.04 LTS upgrade
|
||||
|
||||
The following commands will stop the running DHE, upgrade CS Docker Engine,
|
||||
and then start DHE again:
|
||||
To upgrade CS Docker Engine, run the following command:
|
||||
|
||||
```
|
||||
$ sudo bash -c "$(sudo docker run dockerhubenterprise/manager stop)"
|
||||
$ sudo apt-get update && sudo apt-get dist-upgrade docker-engine-cs
|
||||
$ sudo bash -c "$(sudo docker run dockerhubenterprise/manager start)"
|
||||
$ sudo apt-get update && sudo apt-get dist-upgrade docker-engine-cs
|
||||
```
|
||||
|
||||
## Installing Docker Hub Enterprise
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Quick-start: Basic Workflow
|
||||
page_description: Brief tutorial on the basics of Docker Hub Enterprise user workflow
|
||||
page_keywords: docker, documentation, about, technology, understanding, enterprise, hub, registry, image, repository
|
||||
@@ -9,7 +8,7 @@ page_keywords: docker, documentation, about, technology, understanding, enterpri
|
||||
## Overview
|
||||
|
||||
This Quick Start Guide will give you a hands-on look at the basics of using
|
||||
Docker Hub Enterprise (DHE), Docker's on-premise image storage application.
|
||||
Docker Hub Enterprise (DHE), Docker’s on-premise image storage application.
|
||||
This guide will walk you through using DHE to complete a typical, and critical,
|
||||
part of building a development pipeline: setting up a Jenkins instance. Once you
|
||||
complete the task, you should have a good idea of how DHE works and how it might
|
||||
@@ -18,9 +17,9 @@ be useful to you.
|
||||
Specifically, this guide demonstrates the process of retrieving the
|
||||
[official Docker image for Jenkins](https://registry.hub.docker.com/_/jenkins/),
|
||||
customizing it to suit your needs, and then hosting it on your private instance
|
||||
of DHE located inside your enterprise's firewalled environment. Your developers
|
||||
of DHE located inside your enterprise’s firewalled environment. Your developers
|
||||
will then be able to retrieve the custom Jenkins image in order to use it to
|
||||
build CI/CD infrastructure for their projects, no matter the platform they're
|
||||
build CI/CD infrastructure for their projects, no matter the platform they’re
|
||||
working from, be it a laptop, a VM, or a cloud provider.
|
||||
|
||||
The guide will walk you through the following steps:
|
||||
@@ -45,7 +44,7 @@ You should be able to complete this guide in about thirty minutes.
|
||||
> **Note:** This guide assumes you are familiar with basic Docker concepts such
|
||||
> as images, containers, and registries. If you need to learn more about Docker
|
||||
> fundamentals, please consult the
|
||||
> [Docker user guide](https://docs.docker.com/userguide/).
|
||||
> [Docker user guide](http://docs.docker.com/userguide/).
|
||||
|
||||
First, you will retrieve a copy of the official Jenkins image from the Docker Hub. By default, if
|
||||
Docker can't find an image locally, it will attempt to pull the image from the
|
||||
@@ -73,12 +72,12 @@ Docker will start the process of pulling the image from the Hub. Once it has com
|
||||
|
||||
## Customizing the Jenkins image
|
||||
|
||||
Now that you have a local copy of the Jenkins image, you'll customize it so that
|
||||
Now that you have a local copy of the Jenkins image, you’ll customize it so that
|
||||
the containers it builds will integrate with your infrastructure. To do this,
|
||||
you'll create a custom Docker image that adds a Jenkins plugin that provides
|
||||
fine grained user management. You'll also configure Jenkins to be more secure by
|
||||
you’ll create a custom Docker image that adds a Jenkins plugin that provides
|
||||
fine grained user management. You’ll also configure Jenkins to be more secure by
|
||||
disabling HTTP access and forcing it to use HTTPS.
|
||||
You'll do this by using a `Dockerfile` and the `docker build` command.
|
||||
You’ll do this by using a `Dockerfile` and the `docker build` command.
|
||||
|
||||
> **Note:** These are obviously just a couple of examples of the many ways you
|
||||
> can modify and configure Jenkins. Feel free to add or substitute whatever
|
||||
@@ -106,11 +105,11 @@ line:
|
||||
|
||||
(The plugin version used above was the latest version at the time of writing.)
|
||||
|
||||
2. You will also need to make copies of the server's private key and certificate. Give the copies the following names - `https.key` and `https.pem`.
|
||||
2. You will also need to make copies of the server’s private key and certificate. Give the copies the following names — `https.key` and `https.pem`.
|
||||
|
||||
> **Note:** Because creating new keys varies widely by platform and
|
||||
> implementation, this guide won't cover key generation. We assume you have
|
||||
> access to existing keys. If you don't have access, or can't generate keys
|
||||
> implementation, this guide won’t cover key generation. We assume you have
|
||||
> access to existing keys. If you don’t have access, or can’t generate keys
|
||||
> yourself, feel free to skip the steps involving them and HTTPS config. The
|
||||
> guide will still walk you through building a custom Jenkins image and pushing
|
||||
> and pulling that image using DHE.
|
||||
@@ -143,7 +142,7 @@ defining with the `Dockerfile`.
|
||||
The `RUN` instruction will execute the `/usr/local/bin/plugins.sh` script with
|
||||
the newly copied `plugins` file, which will install the listed plugin.
|
||||
|
||||
The next two `COPY` instructions copy the server's private key and certificate
|
||||
The next two `COPY` instructions copy the server’s private key and certificate
|
||||
into the required directories within the new image.
|
||||
|
||||
The `ENV` instruction creates an environment variable called `JENKINS_OPT` in
|
||||
@@ -157,8 +156,8 @@ tell Jenkins to disable HTTP and operate over HTTPS.
|
||||
|
||||
The `Dockerfile`, the `plugins` file, as well as the private key and
|
||||
certificate, must all be in the same directory because the `docker build`
|
||||
command uses the directory that contains the `Dockerfile` as its "build
|
||||
context". Only files contained within that "build context" will be included in
|
||||
command uses the directory that contains the `Dockerfile` as its “build
|
||||
context”. Only files contained within that “build context” will be included in
|
||||
the image being built.
|
||||
|
||||
### Building your custom image
|
||||
@@ -170,7 +169,7 @@ custom image using the
|
||||
|
||||
docker build -t dhe.yourdomain.com/ci-infrastructure/jnkns-img .
|
||||
|
||||
> **Note:** Don't miss the period (`.`) at the end of the command above. This
|
||||
> **Note:** Don’t miss the period (`.`) at the end of the command above. This
|
||||
> tells the `docker build` command to use the current working directory as the
|
||||
> "build context".
|
||||
|
||||
@@ -215,7 +214,7 @@ image pulled earlier:
|
||||
> ?scope=repository%3Ahello-world%3Apull%2Cpush&service=dhe.yourdomain.com
|
||||
> request failed with status: 401 Unauthorized
|
||||
|
||||
Now that you've created the custom image, it can be pushed to DHE using the
|
||||
Now that you’ve created the custom image, it can be pushed to DHE using the
|
||||
[`docker push`command](https://docs.docker.com/reference/commandline/cli/#push):
|
||||
|
||||
$ docker push dhe.yourdomain.com/ci-infrastructure/jnkns-img
|
||||
@@ -264,7 +263,7 @@ in the output of the `docker images` command:
|
||||
|
||||
## Launching a custom Jenkins container
|
||||
|
||||
Now that you've successfully pulled the customized Jenkins image from DHE, you
|
||||
Now that you’ve successfully pulled the customized Jenkins image from DHE, you
|
||||
can create a container from it with the
|
||||
[`docker run` command](https://docs.docker.com/reference/commandline/cli/#run):
|
||||
|
||||
@@ -300,7 +299,7 @@ You can view the newly launched a container, called `jenkins01`, using the
|
||||
|
||||
The previous `docker run` command mapped port `1973` on the container to port
|
||||
`1973` on the Docker host, so the Jenkins Web UI can be accessed at
|
||||
`https://<docker-host>:1973` (Don't forget the `s` at the end of `https`.)
|
||||
`https://<docker-host>:1973` (Don’t forget the `s` at the end of `https`.)
|
||||
|
||||
> **Note:** If you are using a self-signed certificate, you may get a security
|
||||
> warning from your browser telling you that the certificate is self-signed and
|
||||
@@ -316,7 +315,7 @@ plugin should be present with the `Uninstall` button available to the right.
|
||||

|
||||
|
||||
In another browser session, try to access Jenkins via the default HTTP port 8080
|
||||
`http://<docker-host>:8080`. This should result in a "connection timeout",
|
||||
— `http://<docker-host>:8080`. This should result in a “connection timeout,”
|
||||
showing that Jenkins is not available on its default port 8080 over HTTP.
|
||||
|
||||
This demonstration shows your Jenkins image has been configured correctly for
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
no_version_dropdown: true
|
||||
page_title: Docker Hub Enterprise: Release notes
|
||||
page_description: Release notes for Docker Hub Enterprise
|
||||
page_keywords: docker, documentation, about, technology, understanding, enterprise, hub, registry, release
|
||||
|
||||
@@ -27,7 +27,7 @@ Automated Builds are supported for both public and private repositories
|
||||
on both [GitHub](http://github.com) and [Bitbucket](https://bitbucket.org/).
|
||||
|
||||
To use Automated Builds, you must have an [account on Docker Hub](
|
||||
https://docs.docker.com/userguide/dockerhub/#creating-a-docker-hub-account)
|
||||
http://docs.docker.com/userguide/dockerhub/#creating-a-docker-hub-account)
|
||||
and on GitHub and/or Bitbucket. In either case, the account needs
|
||||
to be properly validated and activated before you can link to it.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# example Dockerfile for https://docs.docker.com/examples/postgresql_service/
|
||||
# example Dockerfile for http://docs.docker.com/examples/postgresql_service/
|
||||
#
|
||||
|
||||
FROM ubuntu
|
||||
|
||||
@@ -21,7 +21,7 @@ Start by creating a new `Dockerfile`:
|
||||
> suitably secure.
|
||||
|
||||
#
|
||||
# example Dockerfile for https://docs.docker.com/examples/postgresql_service/
|
||||
# example Dockerfile for http://docs.docker.com/examples/postgresql_service/
|
||||
#
|
||||
|
||||
FROM ubuntu
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
# Docker Experimental Features
|
||||
page_title: Overview of Experimental Features
|
||||
page_keywords: experimental, Docker, feature
|
||||
|
||||
This page contains a list of features in the Docker engine which are
|
||||
experimental. Experimental features are **not** ready for production. They are
|
||||
provided for test and evaluation in your sandbox environments.
|
||||
# Experimental Features in this Release
|
||||
|
||||
This page contains a list of features in the Docker engine which are
|
||||
experimental as of the current release. Experimental features are **not** ready
|
||||
for production. They are provided for test and evaluation in your sandbox
|
||||
environments.
|
||||
|
||||
The information below describes each feature and the Github pull requests and
|
||||
issues associated with it. If necessary, links are provided to additional
|
||||
@@ -11,8 +15,6 @@ please feel free to provide any feedback on these features you wish.
|
||||
|
||||
## Install Docker experimental
|
||||
|
||||
Unlike the regular Docker binary, the experimental channels is built and updated nightly on https://experimental.docker.com. From one day to the next, new features may appear, while existing experimental features may be refined or entirely removed.
|
||||
|
||||
1. Verify that you have `wget` installed.
|
||||
|
||||
$ which wget
|
||||
@@ -42,13 +44,8 @@ Unlike the regular Docker binary, the experimental channels is built and updated
|
||||
|
||||
This command downloads a test image and runs it in a container.
|
||||
|
||||
## Current experimental features
|
||||
## Experimental features in this Release
|
||||
|
||||
* [Support for Docker plugins](plugins.md)
|
||||
* [Volume plugins](plugins_volume.md)
|
||||
|
||||
## How to comment on an experimental feature
|
||||
|
||||
Each feature's documentation includes a list of proposal pull requests or PRs associated with the feature. If you want to comment on or suggest a change to a feature, please add it to the existing feature PR.
|
||||
|
||||
Issues or problems with a feature? Inquire for help on the `#docker` IRC channel or in on the [Docker Google group](https://groups.google.com/forum/#!forum/docker-user).
|
||||
@@ -1,3 +1,7 @@
|
||||
page_title: Plugin API documentation
|
||||
page_description: Documentation for writing a Docker plugin.
|
||||
page_keywords: docker, plugins, api, extensions
|
||||
|
||||
# Experimental: Docker Plugin API
|
||||
|
||||
Docker plugins are out-of-process extensions which add capabilities to the
|
||||
@@ -1,3 +1,6 @@
|
||||
page_title: Experimental feature - Plugins
|
||||
page_keywords: experimental, Docker, plugins
|
||||
|
||||
# Experimental: Extend Docker with a plugin
|
||||
|
||||
You can extend the capabilities of the Docker Engine by loading third-party
|
||||
@@ -1,3 +1,6 @@
|
||||
page_title: Experimental feature - Volume plugins
|
||||
page_keywords: experimental, Docker, plugins, volume
|
||||
|
||||
# Experimental: Docker volume plugins
|
||||
|
||||
Docker volume plugins enable Docker deployments to be integrated with external
|
||||
@@ -4,7 +4,7 @@ page_keywords: Docker, Docker documentation, Windows, requirements, virtualbox,
|
||||
|
||||
# Windows
|
||||
> **Note:**
|
||||
> Docker has been tested on Windows 7 and 8.1; it may also run on older versions.
|
||||
> Docker has been tested on Windows 7.1 and 8; it may also run on older versions.
|
||||
> Your processor needs to support hardware virtualization.
|
||||
|
||||
The Docker Engine uses Linux-specific kernel features, so to run it on Windows
|
||||
|
||||
@@ -75,9 +75,9 @@ Always rebase and squash your commits before making a pull request.
|
||||
|
||||
6. Edit and save your commit message.
|
||||
|
||||
$ git commit -s
|
||||
`git commit -s`
|
||||
|
||||
Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.
|
||||
Make sure your message includes <a href="./set-up-git" target="_blank>your signature</a>.
|
||||
|
||||
7. Force push any changes to your fork on GitHub.
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ Run the entire test suite on your current repository:
|
||||
|
||||
* creates a new binary
|
||||
* cross-compiles all the binaries for the various operating systems
|
||||
* runs all the tests in the system
|
||||
* runs the all the tests in the system
|
||||
|
||||
It can take several minutes to run all the tests. When they complete
|
||||
successfully, you see the output concludes with something like this:
|
||||
|
||||
@@ -178,9 +178,9 @@ You should pull and rebase frequently as you work.
|
||||
|
||||
6. Edit and save your commit message.
|
||||
|
||||
$ git commit -s
|
||||
`git commit -s`
|
||||
|
||||
Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.
|
||||
Make sure your message includes <a href="./set-up-git" target="_blank>your signature</a>.
|
||||
|
||||
7. Force push any changes to your fork on GitHub.
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ change them using `docker run --env <key>=<value>`.
|
||||
ADD has two forms:
|
||||
|
||||
- `ADD <src>... <dest>`
|
||||
- `ADD ["<src>",... "<dest>"]` (this form is required for paths containing
|
||||
- `ADD ["<src>"... "<dest>"]` (this form is required for paths containing
|
||||
whitespace)
|
||||
|
||||
The `ADD` instruction copies new files, directories or remote file URLs from `<src>`
|
||||
@@ -596,7 +596,7 @@ The copy obeys the following rules:
|
||||
COPY has two forms:
|
||||
|
||||
- `COPY <src>... <dest>`
|
||||
- `COPY ["<src>",... "<dest>"]` (this form is required for paths containing
|
||||
- `COPY ["<src>"... "<dest>"]` (this form is required for paths containing
|
||||
whitespace)
|
||||
|
||||
The `COPY` instruction copies new files or directories from `<src>`
|
||||
|
||||
@@ -1115,9 +1115,6 @@ and Docker images will report:
|
||||
|
||||
untag, delete
|
||||
|
||||
If you do not provide the --since option, the command
|
||||
returns only new and/or live events.
|
||||
|
||||
#### Filtering
|
||||
|
||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If you would like to use
|
||||
|
||||
@@ -1115,10 +1115,8 @@ container's `/etc/hosts` entry will be automatically updated.
|
||||
|
||||
## VOLUME (shared filesystems)
|
||||
|
||||
-v=[]: Create a bind mount with: [host-dir:]container-dir[:rw|ro].
|
||||
If 'host-dir' is missing, then docker creates a new volume.
|
||||
If neither 'rw' or 'ro' is specified then the volume is mounted
|
||||
in read-write mode.
|
||||
-v=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro].
|
||||
If "container-dir" is missing, then docker creates a new volume.
|
||||
--volumes-from="": Mount all volumes from the given container(s)
|
||||
|
||||
The volumes commands are complex enough to have their own documentation
|
||||
|
||||
@@ -22,13 +22,13 @@ repository](https://github.com/docker/docker/blob/master/CHANGELOG.md).
|
||||
|
||||
| Feature | Description |
|
||||
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Container and Image Labels | Labels allow you to attach user-defined metadata to containers and images that can be used by your tools. For additional information on using labels, see [Apply custom metadata](https://docs.docker.com/userguide/labels-custom-metadata/#add-labels-to-images-the-label-instruction) in the documentation. |
|
||||
| Container and Image Labels | Labels allow you to attach user-defined metadata to containers and images that can be used by your tools. For additional information on using labels, see [Apply custom metadata](http://docs.docker.com/userguide/labels-custom-metadata/#add-labels-to-images-the-label-instruction) in the documentation. |
|
||||
| Windows Client preview | The Windows Client can be used just like the Mac OS X client is today with a remote host. Our testing infrastructure was scaled out to accommodate Windows Client testing on every PR to the Engine. See the Azure blog for [details on using this new client](http://azure.microsoft.com/blog/2015/04/16/docker-client-for-windows-is-now-available). |
|
||||
| Logging drivers | The new logging driver follows the exec driver and storage driver concepts already available in Engine today. There is a new option `--log-driver` to `docker run` command. See the `run` reference for a [description on how to use this option](https://docs.docker.com/reference/run/#logging-drivers-log-driver). |
|
||||
| Image digests | When you pull, build, or run images, you specify them in the form `namespace/repository:tag`, or even just `repository`. In this release, you are now able to pull, run, build and refer to images by a new content addressable identifier called a “digest” with the syntax `namespace/repo@digest`. See the the command line reference for [examples of using the digest](https://docs.docker.com/reference/commandline/cli/#listing-image-digests). |
|
||||
| Custom cgroups | Containers are made from a combination of namespaces, capabilities, and cgroups. Docker already supports custom namespaces and capabilities. Additionally, in this release we’ve added support for custom cgroups. Using the `--cgroup-parent` flag, you can pass a specific `cgroup` to run a container in. See [the command line reference for more information](https://docs.docker.com/reference/commandline/cli/#create). |
|
||||
| Ulimits | You can now specify the default `ulimit` settings for all containers when configuring the daemon. For example:`docker -d --default-ulimit nproc=1024:2048` See [Default Ulimits](https://docs.docker.com/reference/commandline/cli/#default-ulimits) in this documentation. |
|
||||
| Commit and import Dockerfile | You can now make changes to images on the fly without having to re-build the entire image. The feature `commit --change` and `import --change` allows you to apply standard changes to a new image. These are expressed in the Dockerfile syntax and used to modify the image. For details on how to use these, see the [commit](https://docs.docker.com/reference/commandline/cli/#commit) and [import](https://docs.docker.com/reference/commandline/cli/#import). |
|
||||
| Logging drivers | The new logging driver follows the exec driver and storage driver concepts already available in Engine today. There is a new option `--log-driver` to `docker run` command. See the `run` reference for a [description on how to use this option](http://docs.docker.com/reference/run/#logging-drivers-log-driver). |
|
||||
| Image digests | When you pull, build, or run images, you specify them in the form `namespace/repository:tag`, or even just `repository`. In this release, you are now able to pull, run, build and refer to images by a new content addressable identifier called a “digest” with the syntax `namespace/repo@digest`. See the the command line reference for [examples of using the digest](http://docs.docker.com/reference/commandline/cli/#listing-image-digests). |
|
||||
| Custom cgroups | Containers are made from a combination of namespaces, capabilities, and cgroups. Docker already supports custom namespaces and capabilities. Additionally, in this release we’ve added support for custom cgroups. Using the `--cgroup-parent` flag, you can pass a specific `cgroup` to run a container in. See [the command line reference for more information](http://docs.docker.com/reference/commandline/cli/#create). |
|
||||
| Ulimits | You can now specify the default `ulimit` settings for all containers when configuring the daemon. For example:`docker -d --default-ulimit nproc=1024:2048` See [Default Ulimits](http://docs.docker.com/reference/commandline/cli/#default-ulimits) in this documentation. |
|
||||
| Commit and import Dockerfile | You can now make changes to images on the fly without having to re-build the entire image. The feature `commit --change` and `import --change` allows you to apply standard changes to a new image. These are expressed in the Dockerfile syntax and used to modify the image. For details on how to use these, see the [commit](http://docs.docker.com/reference/commandline/cli/#commit) and [import](http://docs.docker.com/reference/commandline/cli/#import). |
|
||||
|
||||
### Known issues in Engine
|
||||
|
||||
@@ -62,15 +62,15 @@ around a new set of distribution APIs
|
||||
- **Webhook notifications**: You can now configure the Registry to send Webhooks
|
||||
when images are pushed. Spin off a CI build, send a notification to IRC –
|
||||
whatever you want! Included in the documentation is a detailed [notification
|
||||
specification](https://docs.docker.com/registry/notifications/).
|
||||
specification](http://docs.docker.com/registry/notifications/).
|
||||
|
||||
- **Native TLS support**: This release makes it easier to secure a registry with
|
||||
TLS. This documentation includes [expanded examples of secure
|
||||
deployments](https://docs.docker.com/registry/deploying/).
|
||||
deployments](http://docs.docker.com/registry/deploying/).
|
||||
|
||||
- **New Distribution APIs**: This release includes an expanded set of new
|
||||
distribution APIs. You can read the [detailed specification
|
||||
here](https://docs.docker.com/registry/spec/api/).
|
||||
here](http://docs.docker.com/registry/spec/api/).
|
||||
|
||||
|
||||
## Docker Compose 1.2
|
||||
@@ -86,7 +86,7 @@ with the keyword “extends”. With extends, you can refer to a service defined
|
||||
elsewhere and include its configuration in a locally-defined service, while also
|
||||
adding or overriding configuration as necessary. The documentation describes
|
||||
[how to use extends in your
|
||||
configuration](https://docs.docker.com/compose/extends/#extending-services-in-
|
||||
configuration](http://docs.docker.com/compose/extends/#extending-services-in-
|
||||
compose).
|
||||
|
||||
- **Relative directory handling may cause breaking change**: Compose now treats
|
||||
@@ -103,7 +103,7 @@ another directory.
|
||||
|
||||
You'll find the [release for download on
|
||||
GitHub](https://github.com/docker/swarm/releases/tag/v0.2.0) and [the
|
||||
documentation here](https://docs.docker.com/swarm/). This release includes the
|
||||
documentation here](http://docs.docker.com/swarm/). This release includes the
|
||||
following features:
|
||||
|
||||
- **Spread strategy**: A new strategy for scheduling containers on your cluster
|
||||
@@ -119,7 +119,7 @@ make it possible to use Swarm with clustering systems such as Mesos.
|
||||
|
||||
You'll find the [release for download on
|
||||
GitHub](https://github.com/docker/machine/releases) and [the documentation
|
||||
here](https://docs.docker.com/machine/). For a complete list of machine changes
|
||||
here](http://docs.docker.com/machine/). For a complete list of machine changes
|
||||
see [the changelog in the project
|
||||
repository](https://github.com/docker/machine/blob/master/CHANGES.md#020-2015-03
|
||||
-22).
|
||||
|
||||
@@ -94,7 +94,7 @@ community.
|
||||
## Features of Docker Hub
|
||||
|
||||
Let's take a closer look at some of the features of Docker Hub. You can find more
|
||||
information [here](https://docs.docker.com/docker-hub/).
|
||||
information [here](http://docs.docker.com/docker-hub/).
|
||||
|
||||
* Private repositories
|
||||
* Organizations and teams
|
||||
@@ -163,7 +163,7 @@ a webhook you can specify a target URL and a JSON payload that will be
|
||||
delivered when the image is pushed.
|
||||
|
||||
See the Docker Hub documentation for [more information on
|
||||
webhooks](https://docs.docker.com/docker-hub/repos/#webhooks)
|
||||
webhooks](http://docs.docker.com/docker-hub/repos/#webhooks)
|
||||
|
||||
## Next steps
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ Go to [Docker Swarm user guide](/swarm/).
|
||||
* [Docker homepage](http://www.docker.com/)
|
||||
* [Docker Hub](https://hub.docker.com)
|
||||
* [Docker blog](http://blog.docker.com/)
|
||||
* [Docker documentation](https://docs.docker.com/)
|
||||
* [Docker documentation](http://docs.docker.com/)
|
||||
* [Docker Getting Started Guide](http://www.docker.com/gettingstarted/)
|
||||
* [Docker code on GitHub](https://github.com/docker/docker)
|
||||
* [Docker mailing
|
||||
|
||||
@@ -133,21 +133,6 @@ do_install() {
|
||||
exit 0
|
||||
;;
|
||||
|
||||
'opensuse project'|opensuse|'suse linux'|sled)
|
||||
(
|
||||
set -x
|
||||
$sh_c 'sleep 3; zypper -n install docker'
|
||||
)
|
||||
if command_exists docker && [ -e /var/run/docker.sock ]; then
|
||||
(
|
||||
set -x
|
||||
$sh_c 'docker version'
|
||||
) || true
|
||||
fi
|
||||
echo_docker_as_nonroot
|
||||
exit 0
|
||||
;;
|
||||
|
||||
ubuntu|debian|linuxmint|'elementary os'|kali)
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
man/man*/*
|
||||
docs/man/man*/*
|
||||
|
||||
@@ -9,7 +9,7 @@ override_dh_gencontrol:
|
||||
|
||||
override_dh_auto_build:
|
||||
./hack/make.sh dynbinary
|
||||
# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
||||
# ./docs/man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
||||
|
||||
override_dh_auto_test:
|
||||
./bundles/$(VERSION)/dynbinary/docker -v
|
||||
|
||||
@@ -71,7 +71,7 @@ depending on a particular stack or provider.
|
||||
|
||||
%build
|
||||
./hack/make.sh dynbinary
|
||||
# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
||||
# ./docs/man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
||||
|
||||
%check
|
||||
./bundles/%{_origversion}/dynbinary/docker -v
|
||||
@@ -113,9 +113,9 @@ install -p -m 644 contrib/completion/fish/docker.fish $RPM_BUILD_ROOT/usr/share/
|
||||
|
||||
# install manpages
|
||||
install -d %{buildroot}%{_mandir}/man1
|
||||
install -p -m 644 man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
|
||||
install -p -m 644 docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
|
||||
install -d %{buildroot}%{_mandir}/man5
|
||||
install -p -m 644 man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5
|
||||
install -p -m 644 docs/man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5
|
||||
|
||||
# add vimfiles
|
||||
install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user