mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Add new project, update README
Add files for project running Swarm on Photon with etcd. Update README.md for new project.
This commit is contained in:
parent
77b014618c
commit
c607018e2d
12 changed files with 359 additions and 7 deletions
18
README.md
18
README.md
|
|
@ -8,32 +8,36 @@ This repository contains a variety of files and tools for learning new technolog
|
|||
|
||||
**debian-generic**: This folder has a Vagrant environment for spinning up a generic, 64-bit Debian 8.0 ("Jessie") VM. Note there's nothing special here---just a plain, generic Debian VM.
|
||||
|
||||
**docker-swarm-etcd**: In this folder is a `Vagrantfile` and supporting files for turning up an etcd 2.0-backed Docker Swarm cluster.
|
||||
|
||||
**docker-swarm**: This folder contains a `Vagrantfile` and supporting files to run a Consul-backed Docker Swarm cluster under Vagrant on your local system.
|
||||
|
||||
**docker-swarm-etcd**: In this folder is a `Vagrantfile` and supporting files for turning up an etcd 2.0-backed Docker Swarm cluster.
|
||||
|
||||
**etcd-2.0**: Use the `Vagrantfile` and other files in this directory to turn up an etcd 2.0.9 cluster running on Ubuntu 14.04.
|
||||
|
||||
**lxd-ovs**: Use the `Vagrantfile` and other files in this directory to work with LXD and Open vSwitch (OVS) 2.3.1 on Ubuntu 14.04. Use the instructions from the `lxd` directory to set up containers and container images.
|
||||
|
||||
**lxd**: In this folder you'll find a `Vagrantfile`, instructions, and other files to help work with LXD (pronounced "lex-dee"), a new daemon and CLI for working with LXC-based OS containers.
|
||||
|
||||
**lxd-ovs**: Use the `Vagrantfile` and other files in this directory to work with LXD and Open vSwitch (OVS) 2.3.1 on Ubuntu 14.04. Use the instructions from the `lxd` directory to set up containers and container images.
|
||||
|
||||
**openstack-cli**: This folder contains the files for a Vagrant environment that spins up an Ubuntu box with all the OpenStack CLI clients pre-installed.
|
||||
|
||||
**photon**: This folder contains the files to spin up an instance of the VMware Photon Technical Preview using Vagrant.
|
||||
|
||||
**photon-cloudinit**: This folder contains the files to spin up VMs, using Vagrant and customized via `cloud-init`, running the VMware Photon Technical Preview.
|
||||
|
||||
**photon**: This folder contains the files to spin up an instance of the VMware Photon Technical Preview using Vagrant.
|
||||
**README.md**: This document that you're currently reading.
|
||||
|
||||
**rkt**: This folder contains the files to work with `rkt`, the CoreOS implementation of the App Container (appc) specification, on Ubuntu 14.04. _THIS ENVIRONMENT IS NOT YET FULLY FUNCTIONAL._
|
||||
|
||||
**swarm-consul-openstack**: This folder contains files to create a Consul-backed Docker Swarm cluster on OpenStack. _THIS ENVIRONMENT IS NOT YET FULLY FUNCTIONAL._
|
||||
|
||||
**swarm-etcd2-photon:** This folder contains a Vagrant environment and associated support files to turn up an etcd-backed Docker Swarm cluster where the Docker Engine instances are running on VMware Photon. _THIS ENVIRONMENT IS NOT YET FULLY FUNCTIONAL._
|
||||
|
||||
**ubuntu-generic**: This folder contains a Vagrant environment for spinning up a generic 64-bit Ubuntu 14.04 VM. Note there's nothing special going on here---just a plain, generic, Ubuntu VM.
|
||||
|
||||
**vagrant-docker-yaml**: This folder is an extension of "vagrant-docker" in that it provides the ability to specify the list of Docker containers that Vagrant will create in a separate YAML file.
|
||||
|
||||
**vagrant-docker**: In this folder you'll find `Vagrantfiles` and supporting documents for using the Docker provider in Vagrant to turn up Docker containers.
|
||||
|
||||
**vagrant-docker-yaml**: This folder is an extension of "vagrant-docker" in that it provides the ability to specify the list of Docker containers that Vagrant will create in a separate YAML file.
|
||||
|
||||
## License
|
||||
|
||||
This content is licensed under the MIT License.
|
||||
|
|
|
|||
39
swarm-etcd2-photon/README.md
Normal file
39
swarm-etcd2-photon/README.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Running an etcd-Backed Swarm Cluster on Photon
|
||||
|
||||
These files were created to allow users to use Vagrant ([http://www.vagrantup.com](http://www.vagrantup.com)) to quickly and relatively easily spin up a Docker Swarm cluster on VMware Photon, with discovery services provided by etcd 2.0 on Ubuntu. The configuration was tested using Vagrant 1.7.4 and Oracle VirtualBox 5.0.0.
|
||||
|
||||
## Contents
|
||||
|
||||
* **etcd.conf**: This is an Upstart script (written for Ubuntu) to start etcd. No modifications to this file should be necessary. This file is installed by the provisioning script called in `Vagrantfile`.
|
||||
|
||||
* **etcd.defaults.erb**: A template used by Vagrant to create machine-specific service defaults files for each node in the etcd cluster. The appropriate node-specific file is installed as `etcd` in the `/etc/default` directory on each node by the provisioning script called in `Vagrantfile`.
|
||||
|
||||
* **provision.sh**: This provisioning script is called by the shell provisioner in `Vagrantfile`. It downloads the etcd 2.0.9 release from GitHub, expands it, creates necessary directories, and places files in the appropriate locations. Finally it starts etcd ( or restarts it if already running ).
|
||||
|
||||
* **README.md**: This file you're currently reading.
|
||||
|
||||
* **servers.yml**: This YAML file contains a list of VM definitions. It is referenced by `Vagrantfile` when Vagrant instantiates the VMs. You may need to edit this file to provide appropriate IP addresses and other VM configuration data (see "Instructions" below). _If you change the hostnames or IP addresses provided in this file, you **must** also edit the Upstart override files._
|
||||
|
||||
* **Vagrantfile**: This file is used by Vagrant to spin up the virtual machines. This file is fairly extensively commented to help explain what's happening. You should be able to use this file unchanged; all the VM configuration options are stored outside this file.
|
||||
|
||||
## Instructions
|
||||
|
||||
These instructions assume you've already installed VirtualBox and Vagrant. Please refer to the documentation for those products for more information on installation or configuration.
|
||||
|
||||
1. Use `vagrant box add` to install an Ubuntu 14.04 x64 box for the "virtualbox" provider. (In theory you should be able to use this Vagrant environment with VMware Workstation and VMware Fusion as well, with minor changes to the `Vagrantfile`.) If you don't already have a Vagrant box for Photon, use `vagrant box add` to download a Photon box as well.
|
||||
|
||||
2. Place the files from the `swarm-etcd2-photon` directory of this GitHub repository (the "lowescott/learning-tools" repository) into a directory on your system. You can clone the entire "learning-tools" repository (using `git clone`), or just download the specific files from the `swarm-etcd2-photon` directory.
|
||||
|
||||
3. Edit `servers.yml` to ensure that the box specified in that file matches the Ubuntu 14.04 x64 base box you just installed and will be using. _I recommend that you do not change any other values in this file unless you know it is necessary._
|
||||
|
||||
4. From a terminal window, change into the directory where the files from this directory are stored and run `vagrant up` to bring up the VMs specified in `servers.yml` and `Vagrantfile`.
|
||||
|
||||
5. Once Vagrant has finished creating, booting, and provisioning each of the VMs and starting etcd, log into the first system ("etcd-01" by default) using `vagrant ssh etcd-01`.
|
||||
|
||||
6. You can test etcd with this command:
|
||||
|
||||
etcdctl member list
|
||||
|
||||
This should return a list of three nodes as members of the etcd cluster. If you receive an error or don't see all three VMs listed, tear down the Vagrant environment with `vagrant destroy` and recreate the environment from scratch. If you continue to experience problems, open an issue here on GitHub (or file a pull request fixing the problem).
|
||||
|
||||
Enjoy!
|
||||
111
swarm-etcd2-photon/Vagrantfile
vendored
Normal file
111
swarm-etcd2-photon/Vagrantfile
vendored
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Specify Vagrant version, Vagrant API version, and Vagrant clone location
|
||||
# Adjust commented lines to specify provider
|
||||
Vagrant.require_version ">= 1.6.0"
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
#ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vmware_fusion'
|
||||
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
|
||||
#ENV['VAGRANT_VMWARE_CLONE_DIRECTORY'] = '~/.vagrant'
|
||||
|
||||
# Require 'yaml', 'fileutils', and 'erb' modules
|
||||
require 'yaml'
|
||||
require 'fileutils'
|
||||
require 'erb'
|
||||
|
||||
# Look for user-data file to configure/customize Photon VMs
|
||||
# No changes should need to be made to this file
|
||||
USER_DATA = File.join(File.dirname(__FILE__), "user-data")
|
||||
META_DATA = File.join(File.dirname(__FILE__), "meta-data")
|
||||
|
||||
# Read YAML file with VM details (box, CPU, RAM, IP addresses)
|
||||
# Be sure to edit servers.yml to provide correct IP addresses
|
||||
servers = YAML.load_file('servers.yml')
|
||||
|
||||
# Use config from YAML file to write out templates for etcd overrides
|
||||
template = File.join(File.dirname(__FILE__), 'etcd.defaults.erb')
|
||||
content = ERB.new File.new(template).read
|
||||
|
||||
etcd_initial_cluster = []
|
||||
servers.each do |servers|
|
||||
if servers["etcd"] == "active"
|
||||
etcd_initial_cluster << "#{servers['name']}=http://#{servers['priv_ip']}:2380"
|
||||
end
|
||||
end
|
||||
servers.each do |servers|
|
||||
if servers["etcd"] == "active"
|
||||
ip = servers['priv_ip']
|
||||
target = File.join(File.dirname(__FILE__), "#{servers['name']}.defaults")
|
||||
File.open(target, 'w') { |f| f.write(content.result(binding)) }
|
||||
end
|
||||
end
|
||||
|
||||
# Create and configure the VMs
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
|
||||
# Always use Vagrant's default insecure key
|
||||
config.ssh.insert_key = false
|
||||
|
||||
# Iterate through entries in YAML file to create VMs
|
||||
servers.each do |servers|
|
||||
config.vm.define servers["name"] do |srv|
|
||||
# Don't check for box updates
|
||||
srv.vm.box_check_update = false
|
||||
|
||||
# Set VM hostname and box
|
||||
srv.vm.hostname = servers["name"]
|
||||
srv.vm.box = servers["box"]
|
||||
|
||||
# Set the VM name for use later
|
||||
etcdfilename = servers["name"] + ".defaults"
|
||||
|
||||
# Assign an additional static private network
|
||||
srv.vm.network "private_network", ip: servers["priv_ip"]
|
||||
|
||||
# Disable default synced folder
|
||||
srv.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
|
||||
# Configure VMs based on Photon box
|
||||
if srv.vm.box == "vmware/photon"
|
||||
# Make directory on Photon VMs for cloud-init files
|
||||
srv.vm.provision "shell", inline: "mkdir -p /var/lib/cloud/seed/nocloud", privileged: true
|
||||
|
||||
# Copy user_data file into Photon VMs and more to correct location
|
||||
srv.vm.provision "file", source: "#{USER_DATA}", destination: "/home/vagrant/user-data"
|
||||
srv.vm.provision "shell", inline: "mv /home/vagrant/user-data /var/lib/cloud/seed/nocloud/", privileged: true
|
||||
|
||||
# Copy meta_data file into Photon VMs and more to correct location
|
||||
srv.vm.provision "file", source: "#{USER_DATA}", destination: "/home/vagrant/meta-data"
|
||||
srv.vm.provision "shell", inline: "mv /home/vagrant/meta-data /var/lib/cloud/seed/nocloud/", privileged: true
|
||||
end # srv.vm.box is vmware/photon
|
||||
|
||||
# Configure VMs based on Ubuntu box
|
||||
if srv.vm.box == "ubuntu/trusty64"
|
||||
# Disable default synced folder
|
||||
srv.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
|
||||
# Copy files into the VMs
|
||||
srv.vm.provision "file", source: "#{etcdfilename}", destination: "/home/vagrant/#{etcdfilename}"
|
||||
srv.vm.provision "shell", inline: "mv /home/vagrant/#{etcdfilename} /etc/default/etcd", privileged: true
|
||||
srv.vm.provision "file", source: "etcd.conf", destination: "/home/vagrant/etcd.conf"
|
||||
srv.vm.provision "shell", inline: "mv /home/vagrant/etcd.conf /etc/init/etcd.conf", privileged: true
|
||||
|
||||
# Run final provisioning script
|
||||
srv.vm.provision "shell", path: "provision.sh", privileged: true
|
||||
end # srv.vm.box is ubuntu/trusty64
|
||||
|
||||
# Configure VMs with RAM and CPUs per settings in servers.yml
|
||||
srv.vm.provider :vmware_fusion do |vmw|
|
||||
vmw.vmx["memsize"] = servers["ram"]
|
||||
vmw.vmx["numvcpus"] = servers["vcpu"]
|
||||
end # srv.vm.provider vmware_fusion
|
||||
|
||||
# Configure VirtualBox VMs CPU & RAM per settings in servers.yml
|
||||
srv.vm.provider :virtualbox do |vb|
|
||||
vb.memory = servers["ram"]
|
||||
vb.cpus = servers["vcpu"]
|
||||
end # srv.vm.provider virtualbox
|
||||
end # config.vm.define
|
||||
end # servers each
|
||||
end # Vagrant.configure
|
||||
12
swarm-etcd2-photon/etcd-01.defaults
Normal file
12
swarm-etcd2-photon/etcd-01.defaults
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Override file for etcd Upstart script
|
||||
# Generated from etcd.override.erb by Vagrant
|
||||
# Environment variables
|
||||
export ETCD_INITIAL_CLUSTER="etcd-01=http://192.168.100.101:2380,etcd-02=http://192.168.100.102:2380,etcd-03=http://192.168.100.103:2380"
|
||||
export ETCD_INITIAL_CLUSTER_STATE="new"
|
||||
export ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
|
||||
export ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.101:2380"
|
||||
export ETCD_DATA_DIR="/var/etcd"
|
||||
export ETCD_LISTEN_PEER_URLS="http://192.168.100.101:2380"
|
||||
export ETCD_LISTEN_CLIENT_URLS="http://192.168.100.101:2379,http://0.0.0.0:4001"
|
||||
export ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.101:2379"
|
||||
export ETCD_NAME="etcd-01"
|
||||
12
swarm-etcd2-photon/etcd-02.defaults
Normal file
12
swarm-etcd2-photon/etcd-02.defaults
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Override file for etcd Upstart script
|
||||
# Generated from etcd.override.erb by Vagrant
|
||||
# Environment variables
|
||||
export ETCD_INITIAL_CLUSTER="etcd-01=http://192.168.100.101:2380,etcd-02=http://192.168.100.102:2380,etcd-03=http://192.168.100.103:2380"
|
||||
export ETCD_INITIAL_CLUSTER_STATE="new"
|
||||
export ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
|
||||
export ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.102:2380"
|
||||
export ETCD_DATA_DIR="/var/etcd"
|
||||
export ETCD_LISTEN_PEER_URLS="http://192.168.100.102:2380"
|
||||
export ETCD_LISTEN_CLIENT_URLS="http://192.168.100.102:2379,http://0.0.0.0:4001"
|
||||
export ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.102:2379"
|
||||
export ETCD_NAME="etcd-02"
|
||||
12
swarm-etcd2-photon/etcd-03.defaults
Normal file
12
swarm-etcd2-photon/etcd-03.defaults
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Override file for etcd Upstart script
|
||||
# Generated from etcd.override.erb by Vagrant
|
||||
# Environment variables
|
||||
export ETCD_INITIAL_CLUSTER="etcd-01=http://192.168.100.101:2380,etcd-02=http://192.168.100.102:2380,etcd-03=http://192.168.100.103:2380"
|
||||
export ETCD_INITIAL_CLUSTER_STATE="new"
|
||||
export ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
|
||||
export ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.103:2380"
|
||||
export ETCD_DATA_DIR="/var/etcd"
|
||||
export ETCD_LISTEN_PEER_URLS="http://192.168.100.103:2380"
|
||||
export ETCD_LISTEN_CLIENT_URLS="http://192.168.100.103:2379,http://0.0.0.0:4001"
|
||||
export ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.103:2379"
|
||||
export ETCD_NAME="etcd-03"
|
||||
19
swarm-etcd2-photon/etcd.conf
Normal file
19
swarm-etcd2-photon/etcd.conf
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
description "etcd 2.0 distributed key-value store"
|
||||
author "Scott Lowe <scott.lowe@scottlowe.org>"
|
||||
|
||||
start on (net-device-up
|
||||
and local-filesystems
|
||||
and runlevel [2345])
|
||||
stop on runlevel [016]
|
||||
|
||||
respawn
|
||||
respawn limit 10 5
|
||||
|
||||
script
|
||||
if [ -f "/etc/default/etcd" ]; then
|
||||
. /etc/default/etcd
|
||||
fi
|
||||
|
||||
chdir /var/etcd
|
||||
exec /usr/local/bin/etcd >>/var/log/etcd.log 2>&1
|
||||
end script
|
||||
12
swarm-etcd2-photon/etcd.defaults.erb
Normal file
12
swarm-etcd2-photon/etcd.defaults.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Override file for etcd Upstart script
|
||||
# Generated from etcd.override.erb by Vagrant
|
||||
# Environment variables
|
||||
export ETCD_INITIAL_CLUSTER="<%= etcd_initial_cluster.join(',') %>"
|
||||
export ETCD_INITIAL_CLUSTER_STATE="new"
|
||||
export ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
|
||||
export ETCD_INITIAL_ADVERTISE_PEER_URLS="http://<%= servers['priv_ip'] %>:2380"
|
||||
export ETCD_DATA_DIR="/var/etcd"
|
||||
export ETCD_LISTEN_PEER_URLS="http://<%= servers['priv_ip'] %>:2380"
|
||||
export ETCD_LISTEN_CLIENT_URLS="http://<%= servers['priv_ip'] %>:2379,http://0.0.0.0:4001"
|
||||
export ETCD_ADVERTISE_CLIENT_URLS="http://<%= servers['priv_ip'] %>:2379"
|
||||
export ETCD_NAME="<%= servers['name'] %>"
|
||||
2
swarm-etcd2-photon/meta-data
Normal file
2
swarm-etcd2-photon/meta-data
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
instance-id: iid-local01
|
||||
local-hostname: cloudimg
|
||||
35
swarm-etcd2-photon/provision.sh
Normal file
35
swarm-etcd2-photon/provision.sh
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
# install curl if needed
|
||||
if [[ ! -e /usr/bin/curl ]]; then
|
||||
apt-get update
|
||||
apt-get -yqq install curl
|
||||
fi
|
||||
|
||||
if [[ ! -e /usr/local/bin/etcd ]]; then
|
||||
# Get etcd download
|
||||
curl -sL https://github.com/coreos/etcd/releases/download/v2.1.2/etcd-v2.1.2-linux-amd64.tar.gz -o etcd-v2.1.2-linux-amd64.tar.gz
|
||||
|
||||
# Expand the download
|
||||
tar xzvf etcd-v2.1.2-linux-amd64.tar.gz
|
||||
|
||||
# Move etcd and etcdctl to /usr/local/bin
|
||||
cd etcd-v2.1.2-linux-amd64
|
||||
sudo mv etcd /usr/local/bin/
|
||||
sudo mv etcdctl /usr/local/bin/
|
||||
cd ..
|
||||
|
||||
# Remove etcd download and directory
|
||||
rm etcd-v2.1.2-linux-amd64.tar.gz
|
||||
rm -rf etcd-v2.1.2-linux-amd64
|
||||
|
||||
# Create directories needed by etcd
|
||||
sudo mkdir -p /var/etcd
|
||||
fi
|
||||
|
||||
# Copy files into the correct locations; requires shared folders
|
||||
#sudo cp /vagrant/etcd.conf /etc/init/etcd.conf
|
||||
#sudo cp /vagrant/$HOSTNAME.defaults /etc/default/etcd
|
||||
|
||||
# restart if already running, otherwise start.
|
||||
initctl status etcd && initctl restart etcd || initctl start etcd
|
||||
37
swarm-etcd2-photon/servers.yml
Normal file
37
swarm-etcd2-photon/servers.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: etcd-01
|
||||
box: ubuntu/trusty64
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.101
|
||||
etcd: active
|
||||
- name: etcd-02
|
||||
box: ubuntu/trusty64
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.102
|
||||
etcd: active
|
||||
- name: etcd-03
|
||||
box: ubuntu/trusty64
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.103
|
||||
etcd: active
|
||||
- name: photon-01
|
||||
box: vmware/photon
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.104
|
||||
etcd: inactive
|
||||
- name: photon-02
|
||||
box: vmware/photon
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.105
|
||||
etcd: inactive
|
||||
- name: photon-03
|
||||
box: vmware/photon
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.106
|
||||
etcd: inactive
|
||||
57
swarm-etcd2-photon/user-data
Normal file
57
swarm-etcd2-photon/user-data
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#cloud-config
|
||||
|
||||
groups:
|
||||
- docker: [root,vagrant]
|
||||
write_files:
|
||||
- content: |
|
||||
[Unit]
|
||||
Description=Docker TCP Socket for the API
|
||||
|
||||
[Socket]
|
||||
ListenStream=2375
|
||||
BindIPv6Only=both
|
||||
Service=docker.service
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
path: /etc/systemd/system/docker-tcp.socket
|
||||
owner: root:root
|
||||
permissions: '0644'
|
||||
- content: |
|
||||
[Unit]
|
||||
Description=Docker Socket for the API
|
||||
PartOf=docker.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/var/run/docker.sock
|
||||
SocketMode=0660
|
||||
SocketUser=root
|
||||
SocketGroup=docker
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
path: /lib/systemd/system/docker.socket
|
||||
owner: root:root
|
||||
permissions: '0644'
|
||||
- content: |
|
||||
[Unit]
|
||||
Description=Docker Daemon
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/docker -d -H fd:// -s overlay
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillMode=process
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
path: /lib/systemd/system/docker.service
|
||||
owner: root:root
|
||||
permissions: '0644'
|
||||
runcmd:
|
||||
- systemctl daemon-reload
|
||||
- systemctl enable docker.socket
|
||||
- systemctl enable docker-tcp.socket
|
||||
- systemctl stop docker.service
|
||||
- systemctl start docker-tcp.socket
|
||||
- systemctl start docker.socket
|
||||
Loading…
Reference in a new issue