mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 19:54:38 +00:00
Add base image for mksh
This is a minimal standalone statically linked shell for use for now in converting images to containers. Plan to phase it out and replace with actual programs later. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
f25fa4eb49
commit
f7fcdc5776
@ -10,6 +10,7 @@ RUN \
|
||||
cmake \
|
||||
curl \
|
||||
gmp-dev \
|
||||
groff \
|
||||
installkernel \
|
||||
kmod \
|
||||
linux-headers \
|
||||
|
15
alpine/base/mksh/Dockerfile
Normal file
15
alpine/base/mksh/Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
# Tag: 9e9c6b252d2e4ec03da23c8f48f54fce7ddee8d3
|
||||
FROM mobylinux/alpine-build-c@sha256:68737dcc6a1081f07aace1e82aefe90df399a25ae3a025664c4dbdccf76bbd97
|
||||
|
||||
ENV VERSION=mksh-R54
|
||||
|
||||
RUN curl -O -sSL https://github.com/MirBSD/mksh/archive/$VERSION.tar.gz
|
||||
RUN zcat $VERSION.tar.gz | tar xvf -
|
||||
|
||||
WORKDIR mksh-$VERSION
|
||||
|
||||
ENV LDFLAGS=-static
|
||||
|
||||
RUN sh ./Build.sh
|
||||
RUN strip mksh
|
||||
RUN install -c -s -o root -g bin -m 555 mksh /bin/mksh
|
27
alpine/base/mksh/Makefile
Normal file
27
alpine/base/mksh/Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
.PHONY: tag push
|
||||
|
||||
IMAGE=mksh
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
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
|
||||
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
|
||||
|
||||
.DELETE_ON_ERROR:
|
Loading…
Reference in New Issue
Block a user