2
0
mirror of https://github.com/spritsail/alpine.git synced 2024-11-05 01:16:23 +00:00

Initial commit

This commit is contained in:
Joe Groocock 2018-04-17 12:22:52 +01:00
commit cc21e6f59d
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
5 changed files with 120 additions and 0 deletions

35
.drone.yml Normal file
View File

@ -0,0 +1,35 @@
pipeline:
build:
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: alpine-dev
build_args:
- ALPINE_TAG=${ALPINE_TAG}
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: [ master ], 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:${ALPINE_TAG}'
notify:
image: spritsail/notify
when: { status: [ success, failure ] }
secrets: [ webhook_url, notify_token ]
matrix:
ALPINE_TAG:
- 3.4
- 3.5
- 3.6
- 3.7
- latest
- edge

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
ARG SU_EXEC_VER=v0.3
ARG ALPINE_TAG=3.7
FROM alpine:$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
SHELL ["/bin/sh", "-exc"]
COPY skel/ /
ENV ENV="/etc/profile"
RUN apk --no-cache add \
tini \
openssl \
&& wget -qO /sbin/su-exec https://github.com/frebib/su-exec/releases/download/${SU_EXEC_VER}/su-exec-alpine-$(uname -m) \
&& chmod +x /sbin/su-exec /usr/bin/* \
&& apk --no-cache del openssl
ENTRYPOINT ["/sbin/tini" , "--"]

15
README.md Normal file
View File

@ -0,0 +1,15 @@
[hub]: https://hub.docker.com/r/spritsail/alpine
[git]: https://github.com/spritsail/alpine
[drone]: https://drone.spritsail.io/spritsail/alpine
[mbdg]: https://microbadger.com/images/spritsail/alpine
[musl]: https://www.musl-libc.org/
[uclibc]: https://www.uclibc.org/
# [spritsail/alpine][hub] - Alpine Linux base image
[![Layers](https://images.microbadger.com/badges/image/spritsail/alpine.svg)][mbdg]
[![Latest Version](https://images.microbadger.com/badges/version/spritsail/alpine.svg)][hub]
[![Git Commit](https://images.microbadger.com/badges/commit/spritsail/alpine.svg)][git]
[![Docker Stars](https://img.shields.io/docker/stars/spritsail/alpine.svg)][hub]
[![Docker Pulls](https://img.shields.io/docker/pulls/spritsail/alpine.svg)][hub]
[![Build Status](https://drone.spritsail.io/api/badges/spritsail/alpine/status.svg)][drone]

22
skel/etc/profile Normal file
View File

@ -0,0 +1,22 @@
export PAGER='/bin/less -R'
export EDITOR='/bin/vi'
export PS1='\e[1;36m\u@\h\e[0m \e[0;32m$(ppwd)\e[0m> '
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
unset i
done
# Common interactive aliases
alias ls='ls --color=auto -Fh'
alias ll='ls -l'
alias la='ls -la'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias md='mkdir'
alias dd='rmdir'

19
skel/usr/bin/ppwd Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e -o pipefail
dir="$(echo -n "${1:-$PWD}" | sed "s|$HOME|~|")"
if [ "$dir" = '~' -o "$dir" = '/' ]; then
echo "$dir"
exit 0
fi
parts="$(echo "$dir" | tr '/' '\n' | sed '$d')"
last="$(echo "$dir" | tr '/' '\n' | tail -n 1)"
for d in "$parts"; do
out="$out$(echo "$d" | sed -E '/^\./s/^(.{2}).*/\1/;/^[^\.]/s/^(.{1}).*/\1/')\n"
done
echo -en "$out" | tr '\n' '/'
echo "$last"