mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-18 17:01:07 +00:00
commit
60500940ab
@ -27,7 +27,7 @@ onboot:
|
||||
net: host
|
||||
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
|
||||
- name: metadata
|
||||
image: "linuxkit/metadata:c5567e65e9125f0a4c4b8cb9d56a86377be62652"
|
||||
image: "linuxkit/metadata:a810b68fec9c9282cf096eed50605ddd6b2f3142"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
- /var:/var
|
||||
|
@ -43,7 +43,7 @@ onboot:
|
||||
net: host
|
||||
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
|
||||
- name: metadata
|
||||
image: "linuxkit/metadata:c5567e65e9125f0a4c4b8cb9d56a86377be62652"
|
||||
image: "linuxkit/metadata:a810b68fec9c9282cf096eed50605ddd6b2f3142"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
- /var:/var
|
||||
|
@ -27,7 +27,7 @@ onboot:
|
||||
net: host
|
||||
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
|
||||
- name: metadata
|
||||
image: "linuxkit/metadata:c5567e65e9125f0a4c4b8cb9d56a86377be62652"
|
||||
image: "linuxkit/metadata:a810b68fec9c9282cf096eed50605ddd6b2f3142"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
- /var:/var
|
||||
|
@ -1,24 +1,20 @@
|
||||
kernel:
|
||||
image: "mobylinux/kernel:4.9.x"
|
||||
image: "linuxkit/kernel:4.9.x"
|
||||
cmdline: "console=ttyS0 console=tty0 page_poison=1"
|
||||
init:
|
||||
- "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1"
|
||||
- linuxkit/init:b3740303f3d1e5689a84c87b7dfb48fd2a40a192
|
||||
- linuxkit/runc:2649198589ef0020d99f613adaeda45ce0093a38
|
||||
- linuxkit/containerd:cf2614f5a96c569a0bd4bd54e054a65ba17d167f
|
||||
- linuxkit/ca-certificates:3344cdca1bc59fdfa17bd7f0fcbf491b9dbaa288
|
||||
onboot:
|
||||
- name: sysctl
|
||||
image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
|
||||
image: "linuxkit/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
|
||||
net: host
|
||||
pid: host
|
||||
ipc: host
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
readonly: true
|
||||
services:
|
||||
- name: rngd
|
||||
image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9"
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
oomScoreAdj: -800
|
||||
readonly: true
|
||||
- name: dhcpcd
|
||||
image: "linuxkit/dhcpcd:2def74ab3f9233b4c09ebb196ba47c27c08b0ed8"
|
||||
binds:
|
||||
@ -29,10 +25,51 @@ services:
|
||||
- CAP_NET_BIND_SERVICE
|
||||
- CAP_NET_RAW
|
||||
net: host
|
||||
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
|
||||
- name: format
|
||||
image: "linuxkit/format:d78093e943f9c88386e30c00353f9476d34fb551"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
- CAP_MKNOD
|
||||
- name: mount
|
||||
image: "linuxkit/mount:fc7164d7c4e1fe5d1da395c7f949fb332cffe752"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
- /var:/var:rshared,rbind
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
rootfsPropagation: shared
|
||||
command: ["/mount.sh", "/var/lib/swarmd"]
|
||||
- name: metadata
|
||||
image: "linuxkit/metadata:a810b68fec9c9282cf096eed50605ddd6b2f3142"
|
||||
binds:
|
||||
- /dev:/dev
|
||||
- /var:/var
|
||||
- /tmp/etc/resolv.conf:/etc/resolv.conf
|
||||
net: host
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
services:
|
||||
- name: rngd
|
||||
image: "linuxkit/rngd:61a07ced77a9747708223ca16a4aec621eacf518"
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
oomScoreAdj: -800
|
||||
readonly: true
|
||||
- name: ntpd
|
||||
image: "linuxkit/openntpd:a38eabb308d0405f58894979f8b8031a6c7e1134"
|
||||
capabilities:
|
||||
- CAP_SYS_TIME
|
||||
- CAP_SYS_NICE
|
||||
- CAP_SYS_CHROOT
|
||||
- CAP_SETUID
|
||||
- CAP_SETGID
|
||||
net: host
|
||||
- name: swarmd
|
||||
image: "mobylinux/swarmd:cf11a7626278ebf17efe2780c138b4e626b02c73"
|
||||
command: ["/usr/bin/swarmd", "--containerd-addr=/run/containerd/containerd.sock", "--log-level=debug", "--state-dir=/var/lib/containerd/swarmd"]
|
||||
image: "linuxkit/swarmd:a2f57f14f07fb6d7cded7832b2dabe878b28554e"
|
||||
command: ["/usr/bin/swarmd", "--containerd-addr=/run/containerd/containerd.sock", "--log-level=debug", "--state-dir=/var/lib/swarmd"]
|
||||
capabilities:
|
||||
- CAP_CHOWN
|
||||
- CAP_DAC_OVERRIDE
|
||||
@ -48,10 +85,12 @@ services:
|
||||
- CAP_SYS_CHROOT
|
||||
- CAP_KILL
|
||||
- CAP_AUDIT_WRITE
|
||||
pid: host
|
||||
net: host
|
||||
binds:
|
||||
- /run/containerd/containerd.sock:/run/containerd/containerd.sock
|
||||
- /var/lib/containerd:/var/lib/containerd
|
||||
- /var/lib/swarmd:/var/lib/swarmd
|
||||
- /etc/resolv.conf:/etc/resolv.conf
|
||||
outputs:
|
||||
- format: kernel+initrd
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM golang:1.7-alpine3.5
|
||||
FROM golang:1.7-alpine3.5 AS build
|
||||
|
||||
RUN \
|
||||
apk update && apk upgrade && \
|
||||
@ -10,12 +10,9 @@ RUN \
|
||||
make \
|
||||
&& true
|
||||
|
||||
WORKDIR /
|
||||
COPY Dockerfile.build Dockerfile.pkg Makefile /build/
|
||||
|
||||
# PR https://github.com/docker/swarmkit/pull/1965 from ijc25/containerd
|
||||
ENV SWARMKIT_PR=1965
|
||||
ENV SWARMKIT_COMMIT=82e9f43d84e9a0586903392cbe5bbac15fdbf552
|
||||
ENV SWARMKIT_COMMIT=321b9c6600a9422c3245b277a1b3ae599244d4b7
|
||||
|
||||
RUN mkdir -p $GOPATH/src/github.com/docker && \
|
||||
cd $GOPATH/src/github.com/docker && \
|
||||
@ -32,5 +29,8 @@ RUN strip /build/dist/usr/bin/swarmd /build/dist/usr/bin/swarmctl
|
||||
|
||||
RUN cp -r /etc/ssl /build/dist/etc/ssl
|
||||
|
||||
WORKDIR /build
|
||||
CMD ["/bin/tar", "cf", "-", "-C", "dist", "."]
|
||||
FROM scratch
|
||||
WORKDIR /
|
||||
ENTRYPOINT []
|
||||
COPY --from=build /build/dist /
|
||||
CMD ["/usr/bin/swarmd", "--containerd-addr=/run/containerd/containerd.sock", "--log-level=debug", "--state-dir=/var/lib/swarmd"]
|
@ -1,4 +0,0 @@
|
||||
FROM scratch
|
||||
WORKDIR /
|
||||
ADD swarmd.tar .
|
||||
CMD ["/usr/bin/swarmd", "--containerd-addr=/run/containerd/containerd.sock", "--log-level=debug", "--state-dir=/var/lib/swarmd"]
|
@ -1,38 +1,14 @@
|
||||
.PHONY: tag push clean container
|
||||
.PHONY: tag push
|
||||
all: push
|
||||
|
||||
SHASUM=alpine:3.5
|
||||
IMAGE=swarmd
|
||||
DEPS=Dockerfile.build Makefile
|
||||
|
||||
# Include Dockerfile.pkg here so hash works
|
||||
swarmd.tag: $(DEPS) Dockerfile.pkg
|
||||
BUILD=$$(tar cf - $^ | docker build -f $< -q -) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && echo "$$BUILD" > $@
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
swarmd.tar: swarmd.tag
|
||||
docker run --rm --net=none --log-driver=none $(shell cat swarmd.tag) > $@
|
||||
default: push
|
||||
|
||||
container: Dockerfile.pkg swarmd.tar
|
||||
tar cf - $^ | docker build --no-cache -f $< -t $(IMAGE):build -
|
||||
tag: Dockerfile
|
||||
docker build -t linuxkit/$(IMAGE):$(HASH) .
|
||||
|
||||
hash: $(DEPS) Dockerfile.pkg
|
||||
find $^ -type f | xargs cat | DOCKER_CONTENT_TRUST=1 docker run --rm -i $(SHASUM) sha1sum | sed 's/ .*//' > $@
|
||||
|
||||
push: hash container
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash container
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
rm -f swarmd.tag swarmd.tar
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
push: tag
|
||||
docker pull linuxkit/$(IMAGE):$(HASH) || docker push linuxkit/$(IMAGE):$(HASH)
|
||||
|
Loading…
Reference in New Issue
Block a user