-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d5d54f
commit 6b6f7b9
Showing
30 changed files
with
246 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This file is the work of https://github.com/shinsenter/php | ||
################################################################################ | ||
|
||
ARG BASE_IMAGE=ubuntu:latest | ||
|
||
################################################################################ | ||
|
||
# prepares base image | ||
FROM ${BASE_IMAGE} as build | ||
|
||
# sets version for s6 overlay | ||
ARG S6_DIR=/usr/src/s6/ | ||
ARG S6_SRC_DEP="xz-utils wget" | ||
ARG S6_SRC_URL="https://github.com/just-containers/s6-overlay/releases/download" | ||
ARG S6_VERSION | ||
|
||
# disable frontend | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TERM=xterm | ||
|
||
# checks build argument | ||
RUN if [ -z "$S6_VERSION" ]; then \ | ||
echo "Please set S6_VERSION build argument."; exit 1; \ | ||
fi | ||
|
||
# adds build dependencies | ||
RUN apt-get update -y | ||
RUN apt-get install -y $S6_SRC_DEP --no-install-recommends --no-install-suggests | ||
|
||
# detect system arch then select the right version of s6 | ||
RUN export SYS_ARCH=$(uname -m); \ | ||
case "$SYS_ARCH" in \ | ||
aarch64 ) export S6_ARCH='aarch64' ;; \ | ||
arm ) export S6_ARCH='arm' ;; \ | ||
arm* ) export S6_ARCH='armhf' ;; \ | ||
i4+ ) export S6_ARCH='i486' ;; \ | ||
i6+ ) export S6_ARCH='i686' ;; \ | ||
riscv64 ) export S6_ARCH='riscv64' ;; \ | ||
s390* ) export S6_ARCH='s390x' ;; \ | ||
* ) export S6_ARCH='x86_64' ;; \ | ||
esac; \ | ||
\ | ||
# adds s6 overlay | ||
echo "⬇️ Downloading s6 overlay:${S6_ARCH}-${S6_VERSION} for ${SYS_ARCH}..." \ | ||
&& mkdir -p $S6_DIR \ | ||
&& untar (){ \ | ||
echo " ⏬ Downloading $1"; \ | ||
wget --no-check-certificate -O- $1 | tar Jxp -C ${2:-"$S6_DIR"}; \ | ||
} \ | ||
&& untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-noarch.tar.xz \ | ||
&& untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \ | ||
&& du -sh $S6_DIR | ||
|
||
################################################################################ | ||
|
||
# the main image | ||
FROM scratch | ||
|
||
# copies from from build stage | ||
COPY --from=build /usr/src/s6/ / | ||
ENTRYPOINT ["/init"] | ||
|
||
################################################################################ | ||
|
||
ARG BUILD_NUMBER | ||
LABEL build_number="$BUILD_NUMBER" | ||
LABEL maintainer="[email protected]" | ||
LABEL publisher="https://hub.docker.com/u/shinsenter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# shinsenter/s6-overlay | ||
|
||
The images in this repository contain only the unpacked s6-overlay as a multi-platform build stage. | ||
|
||
https://hub.docker.com/r/shinsenter/s6-overlay | ||
|
||
[![Docker Pulls](https://img.shields.io/docker/pulls/shinsenter/s6-overlay)](https://hub.docker.com/r/shinsenter/s6-overlay) [![Docker Image Size](https://img.shields.io/docker/image-size/shinsenter/s6-overlay/latest?label=shinsenter%2Fs6-overlay)](https://hub.docker.com/r/shinsenter/s6-overlay/tags) | ||
|
||
* * * | ||
|
||
## About this project | ||
|
||
The images in this repository contain only the unpacked [s6-overlay](https://github.com/just-containers/s6-overlay) as a multi-platform and reusable build stage. | ||
|
||
The s6-overlay was built specifically for the lifecycle of containers, giving you a more accurate way of bringing containers down and monitoring their health. | ||
|
||
## Usage | ||
|
||
This repository is not intended to be used directly, but rather consumed in other Dockerfiles as a multi-platform and reusable build stage. | ||
|
||
```Dockerfile | ||
FROM ubuntu | ||
|
||
# adds file from the shinsenter/s6-overlay image | ||
COPY --from=shinsenter/s6-overlay / / | ||
ENTRYPOINT ["/init"] | ||
|
||
# runs other commands | ||
RUN ... | ||
``` | ||
|
||
## Supported platforms | ||
|
||
This repository uses multi-platform images via Docker manifests. You do not need to use a platform-specific tag (although you can); Docker will automatically choose the appropriate architecture. Currently, the supported architectures are: | ||
|
||
- linux/amd64 | ||
- linux/arm/v7 | ||
- linux/arm64 | ||
- linux/ppc64le | ||
- linux/riscv64 | ||
- linux/s390x |
Oops, something went wrong.