mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-04 00:10:15 +00:00
Merge pull request #662 from justincormack/repeat-ami
Add a base image for building AMIs
This commit is contained in:
commit
0f357d2ed5
@ -1,4 +1,4 @@
|
|||||||
DIRS = alpine-base alpine-build-c alpine-build-go
|
DIRS = $(shell find . -type d -depth 1)
|
||||||
.PHONY: clean dirs $(DIRS)
|
.PHONY: clean dirs $(DIRS)
|
||||||
|
|
||||||
push: $(DIRS)
|
push: $(DIRS)
|
||||||
|
14
alpine/base/alpine-aws/Dockerfile
Normal file
14
alpine/base/alpine-aws/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM alpine:3.4
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk update && apk upgrade && \
|
||||||
|
apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
e2fsprogs \
|
||||||
|
jq \
|
||||||
|
python \
|
||||||
|
py-pip \
|
||||||
|
syslinux \
|
||||||
|
&& true
|
||||||
|
|
||||||
|
RUN pip install -U awscli
|
29
alpine/base/alpine-aws/Makefile
Normal file
29
alpine/base/alpine-aws/Makefile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.PHONY: tag push
|
||||||
|
|
||||||
|
BASE=alpine:3.4
|
||||||
|
IMAGE=alpine-aws
|
||||||
|
|
||||||
|
default: push
|
||||||
|
|
||||||
|
hash: Dockerfile
|
||||||
|
docker pull $(BASE)
|
||||||
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||||
|
docker run --rm $(IMAGE):build sh -c '(pip list && cat /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:
|
@ -1,13 +1,5 @@
|
|||||||
FROM alpine
|
FROM mobylinux/alpine-aws:9f937d52372fc1a8a75b57a305d81ca88c522f78
|
||||||
|
|
||||||
RUN apk add --update \
|
|
||||||
python \
|
|
||||||
py-pip \
|
|
||||||
curl \
|
|
||||||
e2fsprogs \
|
|
||||||
jq \
|
|
||||||
syslinux
|
|
||||||
RUN pip install -U awscli
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
RUN mkdir /scripts
|
RUN mkdir /scripts
|
||||||
WORKDIR /scripts
|
WORKDIR /scripts
|
||||||
|
Loading…
Reference in New Issue
Block a user