mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 04:03:11 +00:00
Update sysfs in line with sysctl
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
e4d7e0b90c
commit
f7cc10890d
4
pkg/sysfs/.gitignore
vendored
4
pkg/sysfs/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
dev
|
|
||||||
proc
|
|
||||||
sys
|
|
||||||
usr
|
|
@ -1,3 +1,15 @@
|
|||||||
|
FROM linuxkit/alpine:5f6db26ab7bf6a9c452a612e236cc7495408132b@sha256:d009afc85d0b005daf51c8f3026aa552ab997dc47cab43915e9dc761accae086 AS mirror
|
||||||
|
|
||||||
|
RUN apk add --no-cache go musl-dev
|
||||||
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||||
|
|
||||||
|
COPY main.go /go/src/sysfs/
|
||||||
|
RUN go-compile.sh /go/src/sysfs
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY . ./
|
ENTRYPOINT []
|
||||||
|
CMD []
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=mirror /go/bin/sysfs /usr/bin/sysfs
|
||||||
|
COPY etc/ /etc/
|
||||||
CMD ["/usr/bin/sysfs"]
|
CMD ["/usr/bin/sysfs"]
|
||||||
|
@ -1,45 +1,15 @@
|
|||||||
GO_COMPILE=linuxkit/go-compile:4513068d9a7e919e4ec42e2d7ee879ff5b95b7f5@sha256:bdfadbe3e4ec699ca45b67453662321ec270f2d1a1dbdbf09625776d3ebd68c5
|
.PHONY: tag push
|
||||||
|
default: push
|
||||||
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
|
||||||
|
|
||||||
SYSFS_BINARY=usr/bin/sysfs
|
|
||||||
|
|
||||||
ORG?=linuxkit
|
ORG?=linuxkit
|
||||||
IMAGE=sysfs
|
IMAGE=sysfs
|
||||||
|
DEPS=Dockerfile Makefile main.go
|
||||||
|
|
||||||
.PHONY: tag push clean container
|
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||||
default: push
|
|
||||||
|
|
||||||
$(SYSFS_BINARY): main.go
|
tag: $(DEPS)
|
||||||
mkdir -p $(dir $@)
|
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
|
||||||
tar cf - $^ | docker run --rm --net=none --log-driver=none -i $(GO_COMPILE) -o $@ | tar xf -
|
|
||||||
|
|
||||||
DIRS=dev proc sys
|
push: tag
|
||||||
$(DIRS):
|
docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||||
mkdir -p $@
|
docker push $(ORG)/$(IMAGE):$(HASH)
|
||||||
|
|
||||||
DEPS=$(DIRS) $(SYSFS_BINARY) etc/sysfs.d/00-moby.conf
|
|
||||||
|
|
||||||
container: Dockerfile $(DEPS)
|
|
||||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
|
||||||
|
|
||||||
hash: Dockerfile $(DEPS)
|
|
||||||
find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash
|
|
||||||
|
|
||||||
push: hash container
|
|
||||||
docker pull $(ORG)/$(IMAGE):$(shell cat hash) || \
|
|
||||||
(docker tag $(IMAGE):build $(ORG)/$(IMAGE):$(shell cat hash) && \
|
|
||||||
docker push $(ORG)/$(IMAGE):$(shell cat hash))
|
|
||||||
docker rmi $(IMAGE):build
|
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
tag: hash container
|
|
||||||
docker pull $(ORG)/$(IMAGE):$(shell cat hash) || \
|
|
||||||
docker tag $(IMAGE):build $(ORG)/$(IMAGE):$(shell cat hash)
|
|
||||||
docker rmi $(IMAGE):build
|
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf hash $(DIRS) usr
|
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
|
Loading…
Reference in New Issue
Block a user