Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3157d75f56 | ||
|
|
86f6ef9994 | ||
|
|
8422496b20 | ||
|
|
ca0176e62b | ||
|
|
58eb609ced | ||
|
|
ed24a03e0f | ||
|
|
5a4c36d2a7 | ||
|
|
095b367363 |
4 changed files with 81 additions and 49 deletions
19
Dockerfile
19
Dockerfile
|
|
@ -1,14 +1,14 @@
|
||||||
FROM fedora:rawhide
|
FROM registry.fedoraproject.org/fedora:26
|
||||||
|
|
||||||
ENV container=docker FLANNELD_ETCD_ENDPOINTS="http://127.0.0.1:2379" FLANNELD_ETCD_PREFIX="/atomic.io/network"
|
ENV container=docker FLANNELD_ETCD_ENDPOINTS="http://127.0.0.1:2379" FLANNELD_ETCD_PREFIX="/atomic.io/network"
|
||||||
|
|
||||||
ENV VERSION=0.1 RELEASE=2 ARCH=x86_64
|
ENV VERSION=0 RELEASE=9 ARCH=x86_64
|
||||||
LABEL BZComponent="flannel" \
|
LABEL com.redhat.component="flannel" \
|
||||||
Name="$FGC/flannel" \
|
name="$FGC/flannel" \
|
||||||
Version="$VERSION" \
|
version="$VERSION" \
|
||||||
Release="$RELEASE.$DISTTAG" \
|
release="$RELEASE.$DISTTAG" \
|
||||||
Architecture="$ARCH" \
|
architecture="$ARCH" \
|
||||||
Summary="An etcd driven address agent, intended to be run as a system container" \
|
summary="An etcd driven address agent, intended to be run as a system container" \
|
||||||
maintainer="Giuseppe Scrivano <gscrivan@redhat.com>" \
|
maintainer="Giuseppe Scrivano <gscrivan@redhat.com>" \
|
||||||
atomic.type='system'
|
atomic.type='system'
|
||||||
|
|
||||||
|
|
@ -16,6 +16,9 @@ RUN dnf -y --setopt=tsflags=nodocs install flannel && dnf clean all
|
||||||
|
|
||||||
ADD flanneld-run.sh /usr/bin/
|
ADD flanneld-run.sh /usr/bin/
|
||||||
|
|
||||||
|
RUN mkdir -p /exports/hostfs/etc/sysconfig/ && cp /etc/sysconfig/flanneld /exports/hostfs/etc/sysconfig/
|
||||||
|
RUN mkdir -p /exports/hostfs/etc/flanneld
|
||||||
|
|
||||||
# System container files
|
# System container files
|
||||||
COPY tmpfiles.template service.template manifest.json \
|
COPY tmpfiles.template service.template manifest.json \
|
||||||
config.json.template /exports/
|
config.json.template /exports/
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
{
|
{
|
||||||
"ociVersion": "0.5.0",
|
"ociVersion": "1.0.0",
|
||||||
"platform": {
|
"platform": {
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"arch": "amd64"
|
"arch": "amd64"
|
||||||
},
|
},
|
||||||
"process": {
|
"process": {
|
||||||
"terminal": false,
|
"terminal": false,
|
||||||
"user": {},
|
"user": {
|
||||||
|
"uid": 0,
|
||||||
|
"gid": 0
|
||||||
|
},
|
||||||
"args": [
|
"args": [
|
||||||
"/usr/bin/flanneld-run.sh"
|
"/usr/bin/flanneld-run.sh"
|
||||||
],
|
],
|
||||||
|
|
@ -18,42 +21,43 @@
|
||||||
"NAME=$NAME"
|
"NAME=$NAME"
|
||||||
],
|
],
|
||||||
"cwd": "/",
|
"cwd": "/",
|
||||||
"capabilities": [
|
"capabilities": {
|
||||||
"CAP_FOWNER",
|
"bounding": [
|
||||||
"CAP_FSETID",
|
"CAP_DAC_READ_SEARCH",
|
||||||
"CAP_KILL",
|
"CAP_AUDIT_WRITE",
|
||||||
"CAP_SETGID",
|
"CAP_KILL",
|
||||||
"CAP_SETUID",
|
"CAP_NET_BIND_SERVICE",
|
||||||
"CAP_SETPCAP",
|
"CAP_NET_ADMIN"
|
||||||
"CAP_LINUX_IMMUTABLE",
|
],
|
||||||
"CAP_NET_BIND_SERVICE",
|
"permitted": [
|
||||||
"CAP_NET_BROADCAST",
|
"CAP_DAC_READ_SEARCH",
|
||||||
"CAP_NET_ADMIN",
|
"CAP_AUDIT_WRITE",
|
||||||
"CAP_NET_RAW",
|
"CAP_KILL",
|
||||||
"CAP_IPC_LOCK",
|
"CAP_NET_BIND_SERVICE",
|
||||||
"CAP_IPC_OWNER",
|
"CAP_NET_ADMIN"
|
||||||
"CAP_SYS_MODULE",
|
],
|
||||||
"CAP_SYS_RAWIO",
|
"inheritable": [
|
||||||
"CAP_SYS_CHROOT",
|
"CAP_DAC_READ_SEARCH",
|
||||||
"CAP_SYS_PTRACE",
|
"CAP_AUDIT_WRITE",
|
||||||
"CAP_SYS_PACCT",
|
"CAP_KILL",
|
||||||
"CAP_SYS_ADMIN",
|
"CAP_NET_BIND_SERVICE",
|
||||||
"CAP_SYS_BOOT",
|
"CAP_NET_ADMIN"
|
||||||
"CAP_SYS_NICE",
|
],
|
||||||
"CAP_SYS_RESOURCE",
|
"effective": [
|
||||||
"CAP_SYS_TIME",
|
"CAP_DAC_READ_SEARCH",
|
||||||
"CAP_SYS_TTY_CONFIG",
|
"CAP_AUDIT_WRITE",
|
||||||
"CAP_MKNOD",
|
"CAP_KILL",
|
||||||
"CAP_LEASE",
|
"CAP_NET_BIND_SERVICE",
|
||||||
"CAP_AUDIT_WRITE",
|
"CAP_NET_ADMIN"
|
||||||
"CAP_AUDIT_CONTROL",
|
],
|
||||||
"CAP_SETFCAP",
|
"ambient": [
|
||||||
"CAP_MAC_OVERRIDE",
|
"CAP_DAC_READ_SEARCH",
|
||||||
"CAP_MAC_ADMIN",
|
"CAP_AUDIT_WRITE",
|
||||||
"CAP_SYSLOG",
|
"CAP_KILL",
|
||||||
"CAP_WAKE_ALARM",
|
"CAP_NET_BIND_SERVICE",
|
||||||
"CAP_BLOCK_SUSPEND"
|
"CAP_NET_ADMIN"
|
||||||
],
|
]
|
||||||
|
},
|
||||||
"rlimits": [
|
"rlimits": [
|
||||||
{
|
{
|
||||||
"type": "RLIMIT_NOFILE",
|
"type": "RLIMIT_NOFILE",
|
||||||
|
|
@ -171,7 +175,27 @@
|
||||||
"rbind",
|
"rbind",
|
||||||
"rprivate"
|
"rprivate"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"source": "/etc/sysconfig/flanneld",
|
||||||
|
"destination": "/etc/sysconfig/flanneld",
|
||||||
|
"type": "bind",
|
||||||
|
"options": [
|
||||||
|
"rw",
|
||||||
|
"rbind",
|
||||||
|
"rprivate"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "/etc/flanneld",
|
||||||
|
"destination": "/etc/flanneld",
|
||||||
|
"type": "bind",
|
||||||
|
"options": [
|
||||||
|
"rw",
|
||||||
|
"rbind",
|
||||||
|
"rprivate"
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"hooks": {},
|
"hooks": {},
|
||||||
"linux": {
|
"linux": {
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,12 @@
|
||||||
echo "[Service]" > /etc/systemd/system/docker.service.d/$NAME.conf
|
echo "[Service]" > /etc/systemd/system/docker.service.d/$NAME.conf
|
||||||
echo "EnvironmentFile=-/run/$NAME/docker" >> /etc/systemd/system/docker.service.d/$NAME.conf
|
echo "EnvironmentFile=-/run/$NAME/docker" >> /etc/systemd/system/docker.service.d/$NAME.conf
|
||||||
|
|
||||||
|
source /etc/sysconfig/flanneld
|
||||||
|
|
||||||
# Ensure this file doesn't already exist.
|
# Ensure this file doesn't already exist.
|
||||||
rm -f run/flannel/subnet.env
|
rm -f run/flannel/subnet.env
|
||||||
|
|
||||||
/usr/bin/flanneld &
|
NOTIFY_SOCKET=/dev/null /usr/bin/flanneld -etcd-endpoints=${FLANNEL_ETCD_ENDPOINTS} -etcd-prefix=${FLANNEL_ETCD_PREFIX} -etcd-cafile=${FLANNEL_ETCD_CAFILE} -etcd-certfile=${FLANNEL_ETCD_CERTFILE} -etcd-keyfile=${FLANNEL_ETCD_KEYFILE} $FLANNEL_OPTIONS &
|
||||||
child=$!
|
child=$!
|
||||||
|
|
||||||
while test \! -e /run/flannel/subnet.env
|
while test \! -e /run/flannel/subnet.env
|
||||||
|
|
@ -17,4 +19,6 @@ done
|
||||||
|
|
||||||
/usr/libexec/flannel/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/docker
|
/usr/libexec/flannel/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/docker
|
||||||
|
|
||||||
|
systemd-notify --ready
|
||||||
|
|
||||||
wait $child
|
wait $child
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@ After=$AFTER
|
||||||
Before=docker.service
|
Before=docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
NotifyAccess=all
|
||||||
ExecStart=$EXEC_START
|
ExecStart=$EXEC_START
|
||||||
ExecStop=$EXEC_STOP
|
ExecStop=$EXEC_STOP
|
||||||
ExecStartPost=/usr/bin/sh -c "while test \! -s ${RUN_DIRECTORY}/${NAME}/docker; do sleep 0.1; done"
|
|
||||||
ExecStopPost=/bin/rm /etc/systemd/system/docker.service.d/$NAME.conf
|
ExecStopPost=/bin/rm /etc/systemd/system/docker.service.d/$NAME.conf
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
WorkingDirectory=$DESTDIR
|
WorkingDirectory=$DESTDIR
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue