diff --git a/tools/c-compile/Dockerfile b/tools/c-compile/Dockerfile deleted file mode 100644 index 0ed0cffc9..000000000 --- a/tools/c-compile/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM alpine:3.5 -RUN \ - apk update && apk upgrade && \ - apk add \ - argp-standalone \ - automake \ - bash \ - bsd-compat-headers \ - build-base \ - cmake \ - curl \ - gcc \ - git \ - libc-dev \ - linux-headers \ - make \ - musl-dev \ - patch \ - util-linux-dev \ - vim \ - && true - -COPY compile.sh /usr/bin/ - -ENTRYPOINT ["/usr/bin/compile.sh"] diff --git a/tools/c-compile/Makefile b/tools/c-compile/Makefile deleted file mode 100644 index 864506bd8..000000000 --- a/tools/c-compile/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -.PHONY: tag push - -BASE=alpine:3.5 -IMAGE=c-compile - -default: push - -hash: Dockerfile compile.sh - DOCKER_CONTENT_TRUST=1 docker pull $(BASE) - tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c 'cat /lib/apk/db/installed /usr/bin/compile.sh | sha1sum' | sed 's/ .*//' > hash - -push: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - (docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \ - docker push linuxkit/$(IMAGE):$(shell cat hash)) - docker rmi $(IMAGE):build - rm -f hash - -tag: hash - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) - docker rmi $(IMAGE):build - rm -f hash - -signed-tag: hash - DOCKER_CONTENT_TRUST=1 docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - (DOCKER_CONTENT_TRUST=1 docker pull $(BASE) && \ - docker build --no-cache -t $(IMAGE):build . && \ - docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)) - -sign: signed-tag - DOCKER_CONTENT_TRUST=1 docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - DOCKER_CONTENT_TRUST=1 docker push linuxkit/$(IMAGE):$(shell cat hash) - rm -f hash - docker rmi $(IMAGE):build || true - -clean: - rm -f hash - -.DELETE_ON_ERROR: diff --git a/tools/c-compile/compile.sh b/tools/c-compile/compile.sh deleted file mode 100755 index 333cf2449..000000000 --- a/tools/c-compile/compile.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -# This is designed to compile a single package to a single binary -# so it makes some assumptions about things to simplify config -# to output a single binary (in a tarball) just use -o file -# use --docker to output a tarball for input to docker build - - -set -e - -usage() { - echo "Usage: -o file" - exit 1 -} - -[ $# = 0 ] && usage - -while [ $# -gt 0 ] -do - flag="$1" - case "$flag" in - -o) - [ $# -eq 1 ] && usage - out="$2" - mkdir -p "$(dirname $2)" - shift - ;; - -l*) - LIBS="$LIBS $1" - shift - ;; - *) - echo "Unknown option $1" - exit 1 - esac - shift -done - -[ -z "$out" ] && usage - -package=$(basename "$out") - -dir="/src/$package" - -mkdir -p $dir - -# untar input -tar xf - -C $dir - -( - cd $dir - CFILES=$(find . -name '*.c') - cc -static -O2 -Wall -Werror -o ../../$out $CFILES $LIBS -) - -tar cf - $out -exit 0