Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
feat: Base image v1
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota authored Jan 21, 2020
2 parents 6a01bd5 + 0ad1242 commit 8f0ec35
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://developer.github.com/v3/repos/#edit
repository:
name: docker-$$IMAGE_NAME$$
name: docker-base
description: ""
homepage: https://homecentr.github.io/
private: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master

env:
IMAGE_NAME: "homecentr/$$IMAGE_NAME$$"
IMAGE_NAME: "homecentr/base"

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regular_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- cron: '0 6 * * *'

env:
IMAGE_NAME: "homecentr/$$IMAGE_NAME$$"
IMAGE_NAME: "homecentr/base"

jobs:
build:
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
FROM alpine
FROM alpine:3.11.3 as s6

ENV S6_VERSION="v1.22.1.0"
ENV CPU_ARCH="amd64"

ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${CPU_ARCH}.tar.gz /tmp/

RUN mkdir /s6 && \
tar xzf /tmp/s6-overlay-${CPU_ARCH}.tar.gz -C /s6

FROM scratch

COPY --from=s6 /s6 /

COPY ./etc /etc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# HomeCentr - $$IMAGE_NAME$$
# HomeCentr - base
Template repository for Docker container repositories
26 changes: 26 additions & 0 deletions etc/cont-init.d/10-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/with-contenv ash
PUID=${PUID:-7077}
PGID=${PGID:-7077}

if ( ! type "groupadd" > /dev/null;) || (! type "useradd" > /dev/null; )
then
>&2 echo "Cannot create user, please install shadow package!"
exit 1
fi

addgroup -g $PGID nonroot
adduser -u $PUID -G nonroot -D nonroot

echo '
__ __ __
/ / / /___ ____ ___ ___ ________ ____ / /______
/ /_/ / __ \/ __ `__ \/ _ \/ ___/ _ \/ __ \/ __/ ___/
/ __ / /_/ / / / / / / __/ /__/ __/ / / / /_/ /
/_/ /_/\____/_/ /_/ /_/\___/\___/\___/_/ /_/\__/_/
'
echo "
-------------------------------------
User uid: $(id -u nonroot)
User gid: $(id -g nonroot)
-------------------------------------
"
9 changes: 9 additions & 0 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM base as base

FROM alpine

COPY --from=base / /

RUN apk add --no-cache shadow

ENTRYPOINT [ "/init" ]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "homecentr-$$IMAGE_NAME$$",
"name": "homecentr-base",
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
"url": "git+https://github.com/homecentr/docker-$$IMAGE_NAME$$.git"
"url": "git+https://github.com/homecentr/docker-base.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/homecentr/docker-$$IMAGE_NAME$$/issues"
"url": "https://github.com/homecentr/docker-base/issues"
},
"homepage": "https://github.com/homecentr/docker-$$IMAGE_NAME$$#readme"
"homepage": "https://github.com/homecentr/docker-base#readme"
}

0 comments on commit 8f0ec35

Please sign in to comment.