mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-29 13:38:00 +00:00
Merge pull request #415 from justincormack/repeatable
[WIP] Make builds repeatable by tagging an image based on hash of package install
This commit is contained in:
commit
9b95d939d0
@ -1,34 +1,11 @@
|
||||
FROM alpine:3.4
|
||||
FROM justincormack/moby-alpine-base:0d79ff85d10a7d86067a3893e8a1f52ff3a073da
|
||||
|
||||
ENV ARCH=x86_64
|
||||
|
||||
RUN \
|
||||
addgroup -g 50 docker && \
|
||||
adduser -G docker -u 1001 -s /bin/sh -D -g "Docker" docker && \
|
||||
passwd -d root && \
|
||||
apk update && apk upgrade && \
|
||||
apk add \
|
||||
e2fsprogs \
|
||||
chrony \
|
||||
git \
|
||||
xz \
|
||||
iptables \
|
||||
sfdisk \
|
||||
lvm2 \
|
||||
syslinux \
|
||||
openrc \
|
||||
busybox-initscripts \
|
||||
alpine-conf \
|
||||
bind-tools \
|
||||
openssh-client \
|
||||
strace \
|
||||
fuse \
|
||||
util-linux \
|
||||
cifs-utils \
|
||||
e2fsprogs-extra \
|
||||
openssl \
|
||||
jq \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
passwd -d root
|
||||
|
||||
COPY etc /etc/
|
||||
RUN mkdir -p /etc/docker
|
||||
|
1
alpine/base/.gitignore
vendored
Normal file
1
alpine/base/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
hash
|
26
alpine/base/Dockerfile
Normal file
26
alpine/base/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM alpine:3.4
|
||||
|
||||
RUN \
|
||||
apk update && apk upgrade && \
|
||||
apk add \
|
||||
e2fsprogs \
|
||||
chrony \
|
||||
git \
|
||||
xz \
|
||||
iptables \
|
||||
sfdisk \
|
||||
lvm2 \
|
||||
syslinux \
|
||||
openrc \
|
||||
busybox-initscripts \
|
||||
alpine-conf \
|
||||
bind-tools \
|
||||
openssh-client \
|
||||
strace \
|
||||
fuse \
|
||||
util-linux \
|
||||
cifs-utils \
|
||||
e2fsprogs-extra \
|
||||
openssl \
|
||||
jq \
|
||||
&& rm -rf /var/cache/apk/*
|
26
alpine/base/Makefile
Normal file
26
alpine/base/Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
.PHONY: tag push
|
||||
|
||||
default: push
|
||||
|
||||
hash:
|
||||
docker pull alpine:3.4
|
||||
tar cf - Dockerfile | docker build --no-cache -t justincormack/moby-alpine-base:build -
|
||||
rm -f hash
|
||||
docker run justincormack/moby-alpine-base:build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
docker pull justincormack/moby-alpine-base:$(shell cat hash) || \
|
||||
(docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:latest && \
|
||||
docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:$(shell cat hash) && \
|
||||
docker push justincormack/moby-alpine-base:$(shell cat hash) && \
|
||||
docker push justincormack/moby-alpine-base:latest)
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull justincormack/moby-alpine-base:$(shell cat hash) || \
|
||||
(docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:latest && \
|
||||
docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:$(shell cat hash))
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
Loading…
Reference in New Issue
Block a user