mirror of
https://github.com/rancher/os.git
synced 2025-07-07 03:48:38 +00:00
commit
c8f0d7cdaf
@ -10,10 +10,9 @@ ENV PATH $PATH:/usr/local/go/bin
|
||||
RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
|
||||
ENV GOPATH /go
|
||||
ENV PATH /go/bin:$PATH
|
||||
ENV GO15VENDOREXPERIMENT 1
|
||||
|
||||
RUN pip install tox
|
||||
RUN curl -sSL https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz | tar -xz -C /usr/local
|
||||
RUN curl -sSL https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | tar -xz -C /usr/local
|
||||
RUN curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/local/bin/docker
|
||||
RUN chmod +x /usr/local/bin/docker
|
||||
|
||||
|
6
Makefile
6
Makefile
@ -70,7 +70,11 @@ test: minimal
|
||||
endif
|
||||
|
||||
|
||||
$(BUILD)/images.tar: build/host_ros
|
||||
build/os-config.yml: build/host_ros
|
||||
ARCH=$(ARCH) VERSION=$(VERSION) ./scripts/gen-os-config.sh $@
|
||||
|
||||
|
||||
$(BUILD)/images.tar: build/host_ros build/os-config.yml
|
||||
ARCH=$(ARCH) FORCE_PULL=$(FORCE_PULL) ./scripts/mk-images-tar.sh
|
||||
|
||||
|
||||
|
@ -2,3 +2,8 @@ IMAGE_NAME=rancher/os
|
||||
VERSION=v0.4.4-dev
|
||||
DFS_IMAGE=rancher/docker:v1.10.2
|
||||
SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.1/policy.29
|
||||
|
||||
HOSTNAME_DEFAULT=rancher
|
||||
OS_IMAGES_ROOT=rancher
|
||||
OS_SERVICES_REPO=https://raw.githubusercontent.com/rancher/os-services
|
||||
OS_RELEASES_YML=https://releases.rancher.com/os/releases.yml
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
yaml "github.com/cloudfoundry-incubator/candiedyaml"
|
||||
@ -49,6 +50,12 @@ func configSubcommands() []cli.Command {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "generate",
|
||||
Usage: "Generate a configuration file from a template",
|
||||
Action: runGenerate,
|
||||
HideHelp: true,
|
||||
},
|
||||
{
|
||||
Name: "export",
|
||||
Usage: "export configuration",
|
||||
@ -113,6 +120,30 @@ func runImages(c *cli.Context) {
|
||||
fmt.Println(strings.Join(images, " "))
|
||||
}
|
||||
|
||||
func runGenerate(c *cli.Context) {
|
||||
if err := genTpl(os.Stdin, os.Stdout); err != nil {
|
||||
log.Fatalf("Failed to generate config, err: '%s'", err)
|
||||
}
|
||||
}
|
||||
|
||||
func genTpl(in io.Reader, out io.Writer) error {
|
||||
bytes, err := ioutil.ReadAll(in)
|
||||
if err != nil {
|
||||
log.Fatal("Could not read from stdin")
|
||||
}
|
||||
tpl := template.Must(template.New("osconfig").Parse(string(bytes)))
|
||||
return tpl.Execute(out, env2map(os.Environ()))
|
||||
}
|
||||
|
||||
func env2map(env []string) map[string]string {
|
||||
m := make(map[string]string, len(env))
|
||||
for _, s := range env {
|
||||
d := strings.Split(s, "=")
|
||||
m[d[0]] = d[1]
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func runImport(c *cli.Context) {
|
||||
var input io.ReadCloser
|
||||
var err error
|
||||
|
56
cmd/control/config_test.go
Normal file
56
cmd/control/config_test.go
Normal file
@ -0,0 +1,56 @@
|
||||
package control
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
)
|
||||
|
||||
func TestGenTpl(t *testing.T) {
|
||||
assert := require.New(t)
|
||||
tpl := `
|
||||
services:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
acpid:
|
||||
image: rancher/os-acpid:0.x.x
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
{{end -}}
|
||||
all-volumes:`
|
||||
|
||||
for _, tc := range []struct {
|
||||
arch string
|
||||
expected string
|
||||
}{
|
||||
{"amd64", `
|
||||
services:
|
||||
acpid:
|
||||
image: rancher/os-acpid:0.x.x
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
all-volumes:`},
|
||||
{"arm", `
|
||||
services:
|
||||
all-volumes:`},
|
||||
} {
|
||||
out := &bytes.Buffer{}
|
||||
os.Setenv("ARCH", tc.arch)
|
||||
genTpl(strings.NewReader(tpl), out)
|
||||
assert.Equal(tc.expected, out.String(), tc.arch)
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
hostname: rancher
|
||||
hostname: {{.HOSTNAME_DEFAULT}}
|
||||
rancher:
|
||||
bootstrap:
|
||||
state-script:
|
||||
image: rancher/os-statescript:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-statescript:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
@ -18,7 +18,7 @@ rancher:
|
||||
- /usr/bin/ros:/usr/bin/ros:ro
|
||||
- /usr/share/ros:/usr/share/ros:ro
|
||||
udev-bootstrap:
|
||||
image: rancher/os-udev:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-udev:{{.VERSION}}{{.SUFFIX}}
|
||||
environment:
|
||||
- BOOTSTRAP=true
|
||||
labels:
|
||||
@ -34,7 +34,7 @@ rancher:
|
||||
- /lib/firmware:/lib/firmware
|
||||
autoformat:
|
||||
autoformat:
|
||||
image: rancher/os-autoformat:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-autoformat:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
@ -42,7 +42,7 @@ rancher:
|
||||
net: none
|
||||
privileged: true
|
||||
udev-autoformat:
|
||||
image: rancher/os-udev:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-udev:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
@ -66,15 +66,16 @@ rancher:
|
||||
nameservers: [8.8.8.8, 8.8.4.4]
|
||||
repositories:
|
||||
core:
|
||||
url: https://raw.githubusercontent.com/rancher/os-services/v0.4.4-dev
|
||||
url: {{.OS_SERVICES_REPO}}/{{.VERSION}}
|
||||
state:
|
||||
fstype: auto
|
||||
dev: LABEL=RANCHER_STATE
|
||||
oem_fstype: auto
|
||||
oem_dev: LABEL=RANCHER_OEM
|
||||
services:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
acpid:
|
||||
image: rancher/os-acpid:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-acpid:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
net: host
|
||||
@ -83,8 +84,9 @@ rancher:
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
{{end -}}
|
||||
all-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-state:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
@ -98,7 +100,7 @@ rancher:
|
||||
- user-volumes
|
||||
- system-volumes
|
||||
cloud-init:
|
||||
image: rancher/os-cloudinit:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-cloudinit:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.reloadconfig: "true"
|
||||
@ -111,7 +113,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
cloud-init-pre:
|
||||
image: rancher/os-cloudinit:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-cloudinit:{{.VERSION}}{{.SUFFIX}}
|
||||
environment:
|
||||
- CLOUD_INIT_NETWORK=false
|
||||
labels:
|
||||
@ -126,7 +128,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
command-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-state:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
@ -150,7 +152,7 @@ rancher:
|
||||
- /usr/bin/ros:/usr/sbin/wait-for-network:ro
|
||||
- /usr/bin/ros:/usr/sbin/wait-for-docker:ro
|
||||
console:
|
||||
image: rancher/os-console:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-console:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init
|
||||
@ -166,7 +168,7 @@ rancher:
|
||||
volumes:
|
||||
- /usr/bin/iptables:/sbin/iptables:ro
|
||||
container-data-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-state:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
@ -178,7 +180,7 @@ rancher:
|
||||
- /var/lib/docker:/var/lib/docker
|
||||
- /var/lib/rkt:/var/lib/rkt
|
||||
network:
|
||||
image: rancher/os-network:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-network:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init-pre
|
||||
@ -190,7 +192,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
wait-for-network:
|
||||
image: rancher/os-network:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-network:{{.VERSION}}{{.SUFFIX}}
|
||||
command: wait-for-network
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
@ -202,7 +204,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
ntp:
|
||||
image: rancher/os-ntp:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-ntp:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init, wait-for-network
|
||||
@ -211,7 +213,7 @@ rancher:
|
||||
privileged: true
|
||||
restart: always
|
||||
preload-system-images:
|
||||
image: rancher/os-preload:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-preload:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
@ -223,7 +225,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
preload-user-images:
|
||||
image: rancher/os-preload:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-preload:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
@ -236,7 +238,7 @@ rancher:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
syslog:
|
||||
image: rancher/os-syslog:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-syslog:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
@ -247,7 +249,7 @@ rancher:
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
system-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-state:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
@ -272,7 +274,7 @@ rancher:
|
||||
- /var/log:/var/log
|
||||
- /var/run:/var/run
|
||||
udev-cold:
|
||||
image: rancher/os-udev:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-udev:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.before: udev
|
||||
@ -282,7 +284,7 @@ rancher:
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
udev:
|
||||
image: rancher/os-udev:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-udev:{{.VERSION}}{{.SUFFIX}}
|
||||
environment:
|
||||
- DAEMON=true
|
||||
labels:
|
||||
@ -295,7 +297,7 @@ rancher:
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
user-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-state:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
@ -307,7 +309,7 @@ rancher:
|
||||
- /home:/home
|
||||
- /opt:/opt
|
||||
docker:
|
||||
image: rancher/os-docker:v0.4.4-dev
|
||||
image: {{.OS_IMAGES_ROOT}}/os-docker:{{.VERSION}}{{.SUFFIX}}
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: console
|
||||
@ -326,8 +328,8 @@ rancher:
|
||||
--fixed-cidr, 172.18.42.1/16, --restart=false, -g, /var/lib/system-docker, -G, root,
|
||||
-H, 'unix:///var/run/system-docker.sock', --userland-proxy=false]
|
||||
upgrade:
|
||||
url: https://releases.rancher.com/os/releases.yml
|
||||
image: rancher/os
|
||||
url: {{.OS_RELEASES_YML}}
|
||||
image: {{.OS_IMAGES_ROOT}}/os
|
||||
docker:
|
||||
tls_args: [--tlsverify, --tlscacert=/etc/docker/tls/ca.pem, --tlscert=/etc/docker/tls/server-cert.pem, --tlskey=/etc/docker/tls/server-key.pem,
|
||||
'-H=0.0.0.0:2376']
|
@ -1,328 +0,0 @@
|
||||
hostname: rancher
|
||||
rancher:
|
||||
bootstrap:
|
||||
state-script:
|
||||
image: rancher/os-statescript:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: udev-bootstrap
|
||||
log_driver: json-file
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes:
|
||||
- /dev:/host/dev
|
||||
- /lib/modules:/lib/modules
|
||||
- /lib/firmware:/lib/firmware
|
||||
- /usr/bin/ros:/usr/bin/ros:ro
|
||||
- /usr/share/ros:/usr/share/ros:ro
|
||||
udev-bootstrap:
|
||||
image: rancher/os-udev:v0.4.4-dev_arm
|
||||
environment:
|
||||
- BOOTSTRAP=true
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes:
|
||||
- /dev:/host/dev
|
||||
- /lib/modules:/lib/modules
|
||||
- /lib/firmware:/lib/firmware
|
||||
autoformat:
|
||||
autoformat:
|
||||
image: rancher/os-autoformat:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
udev-autoformat:
|
||||
image: rancher/os-udev:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: autoformat
|
||||
log_driver: json-file
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes:
|
||||
- /dev:/host/dev
|
||||
- /lib/modules:/lib/modules
|
||||
- /lib/firmware:/lib/firmware
|
||||
bootstrap_docker:
|
||||
args: [daemon, -s, overlay, -b, none, --restart=false, -g, /var/lib/system-docker,
|
||||
-G, root, -H, 'unix:///var/run/system-docker.sock', --userland-proxy=false]
|
||||
cloud_init:
|
||||
datasources:
|
||||
- configdrive:/media/config-2
|
||||
network:
|
||||
dns:
|
||||
nameservers: [8.8.8.8, 8.8.4.4]
|
||||
interfaces:
|
||||
eth*:
|
||||
dhcp: true
|
||||
lo:
|
||||
address: 127.0.0.1/8
|
||||
repositories:
|
||||
core:
|
||||
url: https://raw.githubusercontent.com/rancher/os-services/v0.4.4-dev_arm
|
||||
state:
|
||||
fstype: auto
|
||||
dev: LABEL=RANCHER_STATE
|
||||
oem_fstype: auto
|
||||
oem_dev: LABEL=RANCHER_OEM
|
||||
services:
|
||||
all-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
read_only: true
|
||||
volumes_from:
|
||||
- container-data-volumes
|
||||
- command-volumes
|
||||
- user-volumes
|
||||
- system-volumes
|
||||
cloud-init:
|
||||
image: rancher/os-cloudinit:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.reloadconfig: "true"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init-pre, wait-for-network
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
cloud-init-pre:
|
||||
image: rancher/os-cloudinit:v0.4.4-dev_arm
|
||||
environment:
|
||||
- CLOUD_INIT_NETWORK=false
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.reloadconfig: "true"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: preload-system-images
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
command-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
read_only: true
|
||||
volumes:
|
||||
- /usr/bin/docker:/usr/bin/docker.dist:ro
|
||||
- /usr/bin/ros:/usr/bin/dockerlaunch:ro
|
||||
- /usr/bin/ros:/usr/bin/user-docker:ro
|
||||
- /usr/bin/ros:/usr/bin/system-docker:ro
|
||||
- /usr/bin/ros:/sbin/poweroff:ro
|
||||
- /usr/bin/ros:/sbin/reboot:ro
|
||||
- /usr/bin/ros:/sbin/halt:ro
|
||||
- /usr/bin/ros:/sbin/shutdown:ro
|
||||
- /usr/bin/ros:/usr/bin/respawn:ro
|
||||
- /usr/bin/ros:/usr/bin/ros:ro
|
||||
- /usr/bin/ros:/usr/bin/cloud-init:ro
|
||||
- /usr/bin/ros:/usr/sbin/netconf:ro
|
||||
- /usr/bin/ros:/usr/sbin/wait-for-network:ro
|
||||
- /usr/bin/ros:/usr/sbin/wait-for-docker:ro
|
||||
console:
|
||||
image: rancher/os-console:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init
|
||||
io.docker.compose.rebuild: always
|
||||
net: host
|
||||
uts: host
|
||||
pid: host
|
||||
ipc: host
|
||||
privileged: true
|
||||
restart: always
|
||||
volumes_from:
|
||||
- all-volumes
|
||||
volumes:
|
||||
- /usr/bin/iptables:/sbin/iptables:ro
|
||||
container-data-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
read_only: true
|
||||
volumes:
|
||||
- /var/lib/docker:/var/lib/docker
|
||||
- /var/lib/rkt:/var/lib/rkt
|
||||
network:
|
||||
image: rancher/os-network:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init-pre
|
||||
net: host
|
||||
uts: host
|
||||
pid: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
wait-for-network:
|
||||
image: rancher/os-network:v0.4.4-dev_arm
|
||||
command: wait-for-network
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: network
|
||||
pid: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
ntp:
|
||||
image: rancher/os-ntp:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: cloud-init, wait-for-network
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
restart: always
|
||||
preload-system-images:
|
||||
image: rancher/os-preload:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
privileged: true
|
||||
volumes:
|
||||
- /var/run/system-docker.sock:/var/run/docker.sock
|
||||
- /var/lib/system-docker/preload:/mnt/preload
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
preload-user-images:
|
||||
image: rancher/os-preload:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.detach: "false"
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: console
|
||||
privileged: true
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /var/lib/docker/preload:/mnt/preload
|
||||
volumes_from:
|
||||
- command-volumes
|
||||
- system-volumes
|
||||
syslog:
|
||||
image: rancher/os-syslog:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
restart: always
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
system-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
read_only: true
|
||||
volumes:
|
||||
- /dev:/host/dev
|
||||
- /etc/docker:/etc/docker
|
||||
- /etc/hosts:/etc/hosts
|
||||
- /etc/resolv.conf:/etc/resolv.conf
|
||||
- /etc/rkt:/etc/rkt
|
||||
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt.rancher
|
||||
- /lib/firmware:/lib/firmware
|
||||
- /lib/modules:/lib/modules
|
||||
- /run:/run
|
||||
- /usr/share/ros:/usr/share/ros
|
||||
- /var/lib/rancher/conf:/var/lib/rancher/conf
|
||||
- /var/lib/rancher:/var/lib/rancher
|
||||
- /var/log:/var/log
|
||||
- /var/run:/var/run
|
||||
udev-cold:
|
||||
image: rancher/os-udev:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.before: udev
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
udev:
|
||||
image: rancher/os-udev:v0.4.4-dev_arm
|
||||
environment:
|
||||
- DAEMON=true
|
||||
labels:
|
||||
io.rancher.os.detach: "true"
|
||||
io.rancher.os.scope: system
|
||||
net: host
|
||||
uts: host
|
||||
privileged: true
|
||||
restart: always
|
||||
volumes_from:
|
||||
- system-volumes
|
||||
user-volumes:
|
||||
image: rancher/os-state:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.createonly: "true"
|
||||
io.rancher.os.scope: system
|
||||
log_driver: json-file
|
||||
net: none
|
||||
privileged: true
|
||||
read_only: true
|
||||
volumes:
|
||||
- /home:/home
|
||||
- /opt:/opt
|
||||
docker:
|
||||
image: rancher/os-docker:v0.4.4-dev_arm
|
||||
labels:
|
||||
io.rancher.os.scope: system
|
||||
io.rancher.os.after: console
|
||||
net: host
|
||||
pid: host
|
||||
ipc: host
|
||||
uts: host
|
||||
privileged: true
|
||||
restart: always
|
||||
volumes_from:
|
||||
- all-volumes
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/host/sys/fs/cgroup
|
||||
system_docker:
|
||||
args: [daemon, --log-opt, max-size=25m, --log-opt, max-file=2, -s, overlay, -b, docker-sys,
|
||||
--fixed-cidr, 172.18.42.1/16, --restart=false, -g, /var/lib/system-docker, -G, root,
|
||||
-H, 'unix:///var/run/system-docker.sock', --userland-proxy=false]
|
||||
upgrade:
|
||||
url: https://releases.rancher.com/os/releases_arm.yml
|
||||
image: rancher/os
|
||||
docker:
|
||||
tls_args: [--tlsverify, --tlscacert=/etc/docker/tls/ca.pem, --tlscert=/etc/docker/tls/server-cert.pem, --tlskey=/etc/docker/tls/server-key.pem,
|
||||
'-H=0.0.0.0:2376']
|
||||
args: [daemon, --log-opt, max-size=25m, --log-opt, max-file=2, -s, overlay, -G, docker, -H, 'unix:///var/run/docker.sock', --userland-proxy=false]
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
available:
|
||||
- rancher/os:v0.4.0
|
||||
- rancher/os:v0.4.1
|
||||
- rancher/os:v0.4.2
|
||||
- rancher/os:v0.4.3
|
||||
current: rancher/os:v0.4.3
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
available:
|
||||
- rancher/os:v0.4.3_arm
|
||||
current: rancher/os:v0.4.3_arm
|
13
scripts/gen-os-config.sh
Executable file
13
scripts/gen-os-config.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
cd $(dirname $0)/..
|
||||
|
||||
set -a
|
||||
. build.conf
|
||||
|
||||
SUFFIX=""
|
||||
[ "${ARCH}" == "amd64" ] || SUFFIX="_${ARCH}"
|
||||
set +a
|
||||
|
||||
build/host_ros c generate < os-config.tpl.yml > $1
|
@ -1,13 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
suffix=""
|
||||
[ "$ARCH" == "amd64" ] || suffix="_${ARCH}"
|
||||
|
||||
cd $(dirname $0)/..
|
||||
. scripts/build-common
|
||||
|
||||
images="$(build/host_ros c images -i os-config${suffix}.yml)"
|
||||
images="$(build/host_ros c images -i build/os-config.yml)"
|
||||
for i in ${images}; do
|
||||
[ "${FORCE_PULL}" != "1" ] && docker inspect $i >/dev/null 2>&1 || docker pull $i;
|
||||
done
|
||||
|
@ -29,7 +29,7 @@ cp assets/docker ${INITRD_DIR}/usr/bin/docker
|
||||
if [ "$IS_ROOTFS" == "0" ]; then
|
||||
cp ${BUILD}/images.tar ${INITRD_DIR}/usr/share/ros/
|
||||
fi
|
||||
cp os-config${suffix}.yml ${INITRD_DIR}/usr/share/ros/os-config.yml
|
||||
cp build/os-config.yml ${INITRD_DIR}/usr/share/ros/
|
||||
cp bin/ros ${INITRD_DIR}/usr/bin/
|
||||
ln -s usr/bin/ros ${INITRD_DIR}/init
|
||||
ln -s bin ${INITRD_DIR}/usr/sbin
|
||||
|
@ -102,7 +102,7 @@ if [ "$REBUILD" == "1" ]; then
|
||||
|
||||
mkdir -p ${INITRD_TMP}/usr/{bin,share/ros}
|
||||
cp bin/ros ${INITRD_TMP}/usr/bin/
|
||||
cp -f os-config.yml ${INITRD_TMP}/usr/share/ros/
|
||||
cp -f os-config.yml ${INITRD_TMP}/usr/share/ros/ #FIXME: generate os-config.yml from os-config.tpl.yml
|
||||
|
||||
pushd ${INITRD_TMP}
|
||||
find . | cpio -H newc -o | gzip > ${INITRD_TEST}
|
||||
|
Loading…
Reference in New Issue
Block a user