mirror of
https://github.com/spritsail/alpine.git
synced 2025-06-14 15:11:12 +00:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
58a253d336
|
|||
f987f60fff
|
|||
ea70eddebd
|
|||
b1b46fb469
|
|||
ed8af085db
|
|||
4b67afe49d
|
|||
735a1de6ca
|
|||
f8c0652bbc
|
|||
bc6f6539b2
|
|||
e50739bb32 | |||
fa09f2867c
|
|||
438819be65
|
|||
f848ecae6f
|
|||
d7d15ca14d
|
|||
a216ae99b9
|
|||
7d52c725e4
|
|||
c936978f39
|
|||
42dc788197
|
|||
9657e8c188
|
|||
f68f76225f
|
|||
27b5a39581 | |||
a7026a6640
|
|||
9986cc95e2
|
|||
71b9b0a028
|
|||
c6ca28ed56
|
|||
9dfac476e2
|
|||
e3badc0a5b
|
|||
967f4786e3
|
|||
6abb9f9d03
|
|||
f354e4bf4f
|
|||
459fff76af
|
112
.drone.star
Normal file
112
.drone.star
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
repo = "spritsail/alpine"
|
||||||
|
archs = ["amd64", "arm64"]
|
||||||
|
branches = ["master"]
|
||||||
|
versions = {
|
||||||
|
"3.21": [],
|
||||||
|
"3.22": ["latest"],
|
||||||
|
"edge": [],
|
||||||
|
}
|
||||||
|
|
||||||
|
def main(ctx):
|
||||||
|
builds = []
|
||||||
|
|
||||||
|
for ver, tags in versions.items():
|
||||||
|
depends_on = []
|
||||||
|
for arch in archs:
|
||||||
|
key = "build-%s-%s" % (ver, arch)
|
||||||
|
builds.append(step(ver, arch, key))
|
||||||
|
depends_on.append(key)
|
||||||
|
|
||||||
|
if ctx.build.branch in branches:
|
||||||
|
builds.extend(publish(ver, depends_on, tags))
|
||||||
|
|
||||||
|
return builds
|
||||||
|
|
||||||
|
def step(ver, arch, key):
|
||||||
|
vertest = "grep -q '%s' /etc/alpine-release && " % ver if ver != "edge" else ""
|
||||||
|
return {
|
||||||
|
"kind": "pipeline",
|
||||||
|
"name": key,
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
"arch": arch,
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"DOCKER_IMAGE_TOKEN": ver,
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "build",
|
||||||
|
"image": "spritsail/docker-build",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"build_args": [
|
||||||
|
"ALPINE_TAG=%s" % ver,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test",
|
||||||
|
"image": "spritsail/docker-test",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"run": vertest + "su-exec nobody apk --version",
|
||||||
|
"verbose": "true",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "publish",
|
||||||
|
"image": "spritsail/docker-publish",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"registry": {"from_secret": "registry_url"},
|
||||||
|
"login": {"from_secret": "registry_login"},
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"branch": branches,
|
||||||
|
"event": ["push", "cron"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
def publish(ver, depends, tags=[]):
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"kind": "pipeline",
|
||||||
|
"name": "publish-%s-%s" % (ver, name),
|
||||||
|
"depends_on": depends,
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"DOCKER_IMAGE_TOKEN": ver,
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "publish",
|
||||||
|
"image": "spritsail/docker-multiarch-publish",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"src_registry": {"from_secret": "registry_url"},
|
||||||
|
"src_login": {"from_secret": "registry_login"},
|
||||||
|
"dest_registry": registry,
|
||||||
|
"dest_repo": repo,
|
||||||
|
"dest_login": {"from_secret": login_secret},
|
||||||
|
"tags": [ver] + tags,
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"branch": branches,
|
||||||
|
"event": ["push", "cron"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
for name, registry, login_secret in [
|
||||||
|
("dockerhub", "index.docker.io", "docker_login"),
|
||||||
|
("spritsail", "registry.spritsail.io", "spritsail_login"),
|
||||||
|
("ghcr", "ghcr.io", "ghcr_login"),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
# vim: ft=python sw=2
|
26
.drone.yml
26
.drone.yml
@ -1,26 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
build:
|
|
||||||
image: spritsail/docker-build
|
|
||||||
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
|
|
||||||
repo: alpine-dev
|
|
||||||
build_args:
|
|
||||||
- ALPINE_TAG=3.8
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: docker
|
|
||||||
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
|
|
||||||
commands:
|
|
||||||
- docker run --rm alpine-dev /bin/sh -xec 'apk --version'
|
|
||||||
|
|
||||||
publish:
|
|
||||||
image: spritsail/docker-publish
|
|
||||||
when: { branch: [ 3.8 ], event: [ push, tag, deployment ] }
|
|
||||||
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
|
|
||||||
secrets: [ docker_username, docker_password, microbadger_token ]
|
|
||||||
from: alpine-dev
|
|
||||||
repo: 'spritsail/alpine:3.8'
|
|
||||||
|
|
||||||
notify:
|
|
||||||
image: spritsail/notify
|
|
||||||
when: { status: [ success, failure ] }
|
|
||||||
secrets: [ webhook_url, notify_token ]
|
|
41
Dockerfile
41
Dockerfile
@ -1,39 +1,26 @@
|
|||||||
ARG SU_EXEC_VER=v0.3
|
ARG ALPINE_TAG=3.22
|
||||||
ARG ALPINE_TAG=3.8
|
|
||||||
|
|
||||||
FROM alpine:3.7 AS upgrade
|
FROM alpine:$ALPINE_TAG
|
||||||
|
|
||||||
ARG ALPINE_TAG
|
ARG ALPINE_TAG
|
||||||
RUN sed -i "s/3\.7/${ALPINE_TAG}/g" /etc/apk/repositories \
|
|
||||||
&& apk --no-cache upgrade
|
|
||||||
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
LABEL org.opencontainers.image.authors="Spritsail <alpine@spritsail.io>" \
|
||||||
|
org.opencontainers.image.title="Alpine Linux" \
|
||||||
FROM scratch
|
org.opencontainers.image.url="https://github.com/gliderlabs/docker-alpine" \
|
||||||
|
org.opencontainers.image.source="https://github.com/spritsail/alpine" \
|
||||||
COPY --from=upgrade / /
|
org.opencontainers.image.description="Alpine Linux base image" \
|
||||||
|
org.opencontainers.image.version=${ALPINE_TAG}
|
||||||
ARG SU_EXEC_VER
|
|
||||||
ARG ALPINE_TAG
|
|
||||||
|
|
||||||
LABEL maintainer="Spritsail <alpine@spritsail.io>" \
|
|
||||||
org.label-schema.vendor="Spritsail" \
|
|
||||||
org.label-schema.name="Alpine Linux" \
|
|
||||||
org.label-schema.url="https://github.com/gliderlabs/docker-alpine" \
|
|
||||||
org.label-schema.description="Alpine Linux base image" \
|
|
||||||
org.label-schema.version=${ALPINE_TAG} \
|
|
||||||
io.spritsail.version.su-exec=${SU_EXEC_VER}
|
|
||||||
|
|
||||||
# Override shell for sh-y debugging goodness
|
# Override shell for sh-y debugging goodness
|
||||||
SHELL ["/bin/sh", "-exc"]
|
SHELL ["/bin/sh", "-exc"]
|
||||||
|
|
||||||
COPY skel/ /
|
COPY skel/ /
|
||||||
|
ADD https://alpine.spritsail.io/spritsail-alpine.rsa.pub /etc/apk/keys
|
||||||
|
|
||||||
ENV ENV="/etc/profile"
|
ENV ENV="/etc/profile"
|
||||||
RUN apk --no-cache add \
|
RUN sed -i '1ihttps://alpine.spritsail.io/spritsail' /etc/apk/repositories \
|
||||||
tini \
|
&& apk --no-cache add \
|
||||||
openssl \
|
su-exec \
|
||||||
&& wget -qO /sbin/su-exec https://github.com/frebib/su-exec/releases/download/${SU_EXEC_VER}/su-exec-alpine-$(uname -m) \
|
tini
|
||||||
&& chmod +x /sbin/su-exec \
|
|
||||||
&& apk --no-cache del openssl
|
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini" , "--"]
|
ENTRYPOINT ["/sbin/tini" , "--"]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export PAGER='/usr/bin/less -R'
|
export PAGER='/usr/bin/less'
|
||||||
export EDITOR='/usr/bin/vi'
|
export EDITOR='/usr/bin/vi'
|
||||||
export PS1='\e[1;36m\u@\h\e[0m \e[0;32m$(pwd | sed -E '"'s|^'\$HOME'|~|;s|(.*)/|\\1%#|;s|((^\\|/)\\.?[^/%]{1})[^/%]*|\\1|g;s|(.*)%#|\\1/|')"'\e[0m> '
|
export PS1='\e[1;36m\u@\h\e[0m \e[0;32m$(pwd | sed -E '"'s@^'\$HOME'@~@;s@(.*)/@\\1%#@;s@((^|/)\\.?[^/%]{1})[^/%]*@\\1@g;s@(.*)%#@\\1/@')"'\e[0m> '
|
||||||
|
|
||||||
# Source configuration files from /etc/profile.d
|
# Source configuration files from /etc/profile.d
|
||||||
for i in /etc/profile.d/*.sh ; do
|
for i in /etc/profile.d/*.sh ; do
|
||||||
|
Reference in New Issue
Block a user