Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Wilde <ncwilde43@gmail.com>
  • Loading branch information
nicholaswilde committed Feb 26, 2021
1 parent c6b17be commit 2005711
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
# Friendly description to be shown in the UI instead of 'name'
description: 'Version'
# Default value if no value is explicitly provided
default: '0.1.0'
default: '941c0d3'
# Input has to be provided for the workflow to run
required: true
ls:
Expand Down
2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ignore: |

rules:
line-length:
max: 120
max: 140
level: warning
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM golang:1.14.15-alpine3.13 as build
ARG VERSION
ARG COMMIT=941c0d3a20b88384f303af6311fc33ede9d831b4
ENV GO111MODULE on
WORKDIR /go/src/github.com/prologic/todo
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN \
echo "**** install packages ****" && \
apk add --no-cache \
git=2.30.1-r0 \
make=4.3-r0 \
build-base=0.5-r2 && \
echo "**** download todo ****" && \
mkdir /app && \
git clone "https://github.com/prologic/todo.git" /go/src/github.com/prologic/todo && \
git reset --hard "${COMMIT}" && \
go get -v -d && \
go install -v && \
go build . && \
echo "**** cleanup ****" && \
rm -rf \
./*.md \
.github \
screenshots

FROM ghcr.io/linuxserver/baseimage-alpine:3.13
ARG BUILD_DATE
ARG VERSION
ENV GOPATH /go
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="nicholaswilde"
COPY --from=build --chown=abc:abc /go /go
COPY root/ /
RUN \
mkdir /data && \
ln -s /go/src/github.com/prologic/todo / && \
chown -R abc:abc \
/data \
/go
WORKDIR /go/src/github.com/prologic/todo
EXPOSE 8000/tcp
VOLUME \
/data \
/todo
35 changes: 0 additions & 35 deletions Dockerfile.alpine

This file was deleted.

42 changes: 0 additions & 42 deletions Dockerfile.ubuntu

This file was deleted.

26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Docker Template
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/nicholaswilde/template)](https://hub.docker.com/r/nicholaswilde/template)
[![Docker Pulls](https://img.shields.io/docker/pulls/nicholaswilde/template)](https://hub.docker.com/r/nicholaswilde/template)
[![GitHub](https://img.shields.io/github/license/nicholaswilde/docker-template)](./LICENSE)
[![ci](https://github.com/nicholaswilde/docker-template/workflows/ci/badge.svg)](https://github.com/nicholaswilde/docker-template/actions?query=workflow%3Aci)
[![lint](https://github.com/nicholaswilde/docker-template/workflows/lint/badge.svg?branch=main)](https://github.com/nicholaswilde/docker-template/actions?query=workflow%3Alint)
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/nicholaswilde/todo)](https://hub.docker.com/r/nicholaswilde/todo)
[![Docker Pulls](https://img.shields.io/docker/pulls/nicholaswilde/todo)](https://hub.docker.com/r/nicholaswilde/todo)
[![GitHub](https://img.shields.io/github/license/nicholaswilde/docker-todo)](./LICENSE)
[![ci](https://github.com/nicholaswilde/docker-todo/workflows/ci/badge.svg)](https://github.com/nicholaswilde/docker-todo/actions?query=workflow%3Aci)
[![lint](https://github.com/nicholaswilde/docker-todo/workflows/lint/badge.svg?branch=main)](https://github.com/nicholaswilde/docker-todo/actions?query=workflow%3Alint)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

A multi-architecture image for [template](https://github.com/nicholaswilde/docker-template).
A multi-architecture image for [todo](https://github.com/prologic/todo).

## Architectures

Expand All @@ -19,17 +19,19 @@ A multi-architecture image for [template](https://github.com/nicholaswilde/docke
* None

## Usage

### docker cli

```bash
$ docker run -d \
--name=template-default \
--name=todo-default \
-e TZ=America/Los_Angeles `# optional` \
-e PUID=1000 `# optional` \
-e PGID=1000 `# optional` \
-p 3000:3000 \
-e PUID=1000 `# optional` \
-e PGID=1000 `# optional` \
-e THEME=ayu `# optional` \
-p 8000:8000 \
--restart unless-stopped \
nicholaswilde/template
nicholaswilde/todo
```

### docker-compose
Expand All @@ -42,6 +44,8 @@ See [docker-compose.yaml](./docker-compose.yaml).
|----:|:---:|
| abc | 911 |

See [todo](https://github.com/prologic/todo#configuration) for more configuration options.

## Development

See [Wiki](https://github.com/nicholaswilde/docker-template/wiki/Development).
Expand Down
14 changes: 8 additions & 6 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vars:
sh: "date -u +%Y-%m-%dT%H%M%S%Z"
BUILD_ARGS: >-
--build-arg VERSION={{ .VERSION }}
--build-arg CHECKSUM={{ .CHECKSUM }}
--build-arg COMMIT={{ .COMMIT }}
--build-arg BUILD_DATE={{ .BUILD_DATE }}
TAG_VERSION: "{{ .NS }}/{{ .IMAGE_NAME }}:{{ .VERSION }}-ls{{ .LS }}"
TAG_LATEST: "{{ .NS }}/{{ .IMAGE_NAME }}:latest"
Expand Down Expand Up @@ -38,8 +38,8 @@ tasks:
deps:
- build:build-deps

checksum:
desc: Get the checksum of the release or source package.
COMMIT:
desc: Get the COMMIT of the release or source package.
deps:
- chk:_varcheck
- chk:_release
Expand All @@ -56,10 +56,11 @@ tasks:
- "hadolint Dockerfile"
- "yamllint ."
preconditions:
- sh: type hadolint2
- sh: type hadolint
msg: "hadolint is not installed. Run 'task deps:hadolint'"
- sh: type yamllint
msg: "yamllint is not installed. Run 'task deps:yamllint'"
silent: true

load:
desc: Load the release image
Expand Down Expand Up @@ -130,7 +131,7 @@ tasks:
cmds:
- "printf 'task: Available variables for this project:\n'"
- 'printf "{{ .COLOR }}* BASE\e[m %s\n" "{{ .BASE }}"'
- 'printf "{{ .COLOR }}* CHECKSUM\e[m %s\n" "{{ .CHECKSUM }}"'
- 'printf "{{ .COLOR }}* COMMIT\e[m %s\n" "{{ .COMMIT }}"'
- 'printf "{{ .COLOR }}* CONTAINER\e[m %s\n" "{{ .CONTAINER }}"'
- 'printf "{{ .COLOR }}* CONTAINER_INSTANCE\e[m %s\n" "{{ .CONTAINER_INSTANCE }}"'
- 'printf "{{ .COLOR }}* CONTAINER_NAME\e[m %s\n" "{{ .CONTAINER_NAME }}"'
Expand All @@ -149,7 +150,8 @@ tasks:
- 'printf "{{ .COLOR }}* TYPE\e[m %s\n" "{{ .TYPE }}"'
- 'printf "{{ .COLOR }}* VERSION\e[m %s\n" "{{ .VERSION }}"'
vars:
COLOR: '\e[1;34m' # Blue
# Blue
COLOR: '\e[1;34m'
silent: true

default:
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
version: "2.1"
services:
template:
image: nicholaswilde/template:latest
container_name: template-default
todo:
image: nicholaswilde/todo:latest
container_name: todo-default
environment:
THEME: ayu
ports:
- 3000:3000
- 8000:8000
restart: unless-stopped
volumes:
- app:/app
- config:/config
- defaults:/defaults
- todo:/todo
- data:/data
volumes:
app:
config:
defaults:
todo:
data:
3 changes: 2 additions & 1 deletion root/etc/cont-init.d/30-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# permissions
chown -R abc:abc \
/config
/data \
/go
12 changes: 0 additions & 12 deletions root/etc/services.d/appname/run

This file was deleted.

8 changes: 8 additions & 0 deletions root/etc/services.d/todo/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bash

cd /go/src/github.com/prologic/todo/ || exit 1

exec \
s6-setuidgid abc \
/go/src/github.com/prologic/todo/todo \
-dbpath /data
16 changes: 8 additions & 8 deletions task.env
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Release
VERSION=0.1.0
VERSION=941c0d3
LS=1
NS=nicholaswilde

IMAGE_NAME=template
IMAGE_NAME=todo
CONTAINER_NAME=${IMAGE_NAME}
CONTAINER_INSTANCE=default

# Source information used to download source files
# release, source, or commit
TYPE=source
SOURCE_REPO=${IMAGE_NAME}
SOURCE_ORG=Leantime
SOURCE_ORG=prologic
FILENAME=${VERSION}.tar.gz

# Run
ENV= -e TZ=America/Los_Angeles -e PUID=1000 -e PGID=1000
ENV= -e TZ=America/Los_Angeles -e PUID=1000 -e PGID=1000 -e THEME=ayu

PORTS=-p 3000:3000
PORTS=-p 8000:8000

# Build
PLATFORMS="--platform linux/arm/v7,linux/arm64,linux/amd64"
CHECKSUM=
COMMIT=941c0d3a20b88384f303af6311fc33ede9d831b4

# Packages
BASE=alpine:3.13.1
PACKAGES=wget ca-certificates git curl npm nodejs tzdata
BASE=golang:1.14.15-alpine3.13
PACKAGES=wget ca-certificates git curl npm nodejs tzdata make build-base

PIP=

0 comments on commit 2005711

Please sign in to comment.