mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 18:41:37 +00:00
tools: Remove c-compile
It is not longer used by any package. Some projects still use it and I haven't updated their builds but they should continue to work. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
662ed3ad1f
commit
2273a1c9a8
@ -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"]
|
@ -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:
|
@ -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
|
Loading…
Reference in New Issue
Block a user