Skip to content

Commit

Permalink
Rebuild docker-template v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MickMake committed Apr 3, 2020
1 parent a71fc0f commit ada8808
Show file tree
Hide file tree
Showing 12 changed files with 232 additions and 45 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ name: release

on:
release:
types: [published]
types: [published, edited]

jobs:
build_docker_images:
runs-on: ubuntu-latest
name: Building Images for ${{ github.ref }}
strategy:
matrix:
versions: [all]
runs-on: ubuntu-latest
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -21,16 +24,11 @@ jobs:
with:
ref: ${{ github.ref }}
- name: 02-list
run: ls -l
run: ls -l versions
- name: 03-build
# run: make ${{steps.pull.args }}
run: make build-all
- name: 04-test
# run: make ${{ steps.pull.args }}
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${SSH_KEY}"
make test-all
- name: 05-push
run: |
docker login --username gearboxbuild --password "${DOCKERHUB_TOKEN}"
make dockerhub-all
make release-${{ matrix.versions }}
96 changes: 86 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,98 @@ GitHub release(latest): ![last-release-date](https://img.shields.io/github/relea
## Supported versions and respective Dockerfiles
| Service | GitHub Version | Docker Version | Docker Size | Docker Tags |
| ------- | -------------- | -------------- | ----------- | ----------- |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.12.2-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.12.2) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.12.2) | _([`1.12.2`, `1.12`](https://github.com/gearboxworks/docker-nginx/blob/master/1.12/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.13.12-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.13.12) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.13.12) | _([`1.13.12`, `1.13`](https://github.com/gearboxworks/docker-nginx/blob/master/1.13/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.14.2-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.14.2) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.14.2) | _([`1.14.2`, `1.14`](https://github.com/gearboxworks/docker-nginx/blob/master/1.14/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.15.9-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.15.9) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.15.9) | _([`1.15.9`, `1.15`, `latest`](https://github.com/gearboxworks/docker-nginx/blob/master/1.15/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.12.2-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.12.2)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | [![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.12.2)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | _([`1.12.2`, `1.12`](https://github.com/gearboxworks/docker-nginx/blob/master/versions/1.12.2/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.13.12-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.13.12)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | [![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.13.12)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | _([`1.13.12`, `1.13`](https://github.com/gearboxworks/docker-nginx/blob/master/versions/1.13.12/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.14.2-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.14.2)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | [![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.14.2)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | _([`1.14.2`, `1.14`](https://github.com/gearboxworks/docker-nginx/blob/master/versions/1.14.2/DockerfileRuntime))_ |
| [nginx](unknown) | ![nginx](https://img.shields.io/badge/nginx-1.15.9-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/gearboxworks/nginx/1.15.9)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | [![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/nginx/1.15.9)](https://hub.docker.com/repository/docker/gearboxworks/nginx) | _([`1.15.9`, `1.15`, `latest`](https://github.com/gearboxworks/docker-nginx/blob/master/versions/1.15.9/DockerfileRuntime))_ |


## About this container.
A driving force behind [Gearbox](https://github.com/gearboxworks/) is to improve the user experience using software, and especially for software developers.

Our vision is to empower developers and other software users to quickly and easily use almost any version of a software service, command line tool or API without without first getting bogged down with installation and configuration.

In other words, our vision for [Gearbox](https://github.com/gearboxworks/) users is that software "**just works**".


## Using this container.
This container has been designed to work within the [Gearbox](https://github.com/gearboxworks/)
framework.
This container has been designed to work within the [Gearbox](https://github.com/gearboxworks/) framework.
However, due to the flexability of Gearbox, it can be used outside of this framework.
You can either use it directly from DockerHub or GitHub.

There are three methods:

## Method 1: Using gb-launch
`gb-launch` is a tool specifically designed to interact with a Gearbox Docker container.

It provides three important functional areas, without any Docker container learning curve:
- Allows control over Gearbox Docker containers: stop, start, create, remove.
- Build, update, modify and release Docker images.
- Acts as a proxy for interactive commands within a Gearbox Docker container.

It also provides a functional SSH daemon for connecting remotely as well as a standard set of common tools and utilities.


### Setup from GitHub repo
`gb-launch` is currently in beta testing and is included along with all Gearbox Docker repos.
Once out of beta, it will be included within the Gearbox installation package.

For now, simply clone this repository to your local machine.

`git clone https://github.com/gearboxworks/docker-nginx.git`

### Running gb-launch
There are many ways to call gb-launch, either directly or indirectly.
Additionally, all host environment variables will be imported into the container seamlessly.
This allows a devloper to try multiple versions of software as though they were installed locally.

If a container is missing, it will be downloaded and created. Multiple versions can co-exist.

Create, and start the nginx Gearbox container.

`./bin/gb-launch -gb-name nginx`

Create, and start the nginx Gearbox container. Run a shell.

`./bin/gb-launch -gb-name nginx -gb-shell`

Create, and start the nginx Gearbox container with version 1.12.2 and run a shell.

## Method 1: GitHub repo
`./bin/gb-launch -gb-name nginx -gb-version 1.12.2 -gb-shell`

If nginx is symlinked to `gb-launch`, then you can drop the `-gb-name` flag.

`./bin/nginx`

Running nginx Gearbox container default command. If a container has a default interactive command, arguments can be supplied without specifying that command.

`./bin/nginx -flag1 -flag2 variable`

`./bin/gb-launch -gb-name nginx -gb-version 1.12.2 -flag1 -flag2 variable`


Running alternate commands within the nginx Gearbox container.

`./bin/nginx -gb-shell -- ls -l`

`./bin/gb-launch -gb-name nginx -gb-version 1.12.2 -gb-shell -- ls -l`

`./bin/nginx -gb-shell -- ps -eaf`

`./bin/gb-launch -gb-name nginx -gb-version 1.12.2 -gb-shell -- ps -eaf`


ssh - All [Gearbox](https://github.com/gearboxworks/) containers have a running SSH daemon. So you can connect remotely.
To show what ports are exported to the host.

`./bin/gb-launch -gb-name nginx -gb-list`


## Method 2: GitHub repo

### Setup from GitHub repo
Simply clone this repository to your local machine

`git clone https://github.com/gearboxworks/nginx-docker.git`
`git clone https://github.com/gearboxworks/docker-nginx.git`

### Building from GitHub repo
`make build` - Build Docker images. Build all versions from the base directory or specific versions from each directory.
Expand All @@ -59,7 +132,7 @@ You can either build your container as above, or use it from DockerHub with thes
`make test` - Will issue a `stop`, `rm`, `clean`, `build`, `create` and `start` on a Docker container.


## Method 2: Docker Hub
## Method 3: Docker Hub

### Setup from Docker Hub
A simple `docker pull gearbox/nginx` will pull down the latest version.
Expand Down Expand Up @@ -92,6 +165,9 @@ shell - Run a shell, (/bin/bash), within a Docker container.
### SSH
ssh - All [Gearbox](https://github.com/gearboxworks/) containers have a running SSH daemon. So you can connect remotely.

Either use `gb-launch` above or discover the port and SSH directly.


```
SSH_PORT="$(docker port nginx-latest 22/tcp | sed 's/0.0.0.0://')"
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no gearbox@localhost
Expand Down
98 changes: 88 additions & 10 deletions TEMPLATE/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This is the repository for the [{{ .Json.meta.name }}]({{ .Json.meta.refurl }})


## Repository Info
GitHub commit: ![commit-date](https://img.shields.io/github/last-commit/gearboxworks/docker-{{ .Json.meta.name }}?style=flat-square)
GitHub commit: ![commit-date](https://img.shields.io/github/last-commit/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}?style=flat-square)

GitHub release(latest): ![last-release-date](https://img.shields.io/github/release-date/gearboxworks/docker-{{ .Json.meta.name }}) ![last-release-date](https://img.shields.io/github/v/tag/gearboxworks/docker-{{ .Json.meta.name }}?sort=semver) [![release-state](https://github.com/gearboxworks/docker-{{ .Json.meta.name }}/workflows/release/badge.svg?event=release)](https://github.com/gearboxworks/docker-{{ .Json.meta.name }}/actions?query=workflow%3Arelease)
GitHub release(latest): ![last-release-date](https://img.shields.io/github/release-date/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}) ![last-release-date](https://img.shields.io/github/v/tag/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}?sort=semver) [![release-state](https://github.com/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}/workflows/release/badge.svg?event=release)](https://github.com/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}/actions?query=workflow%3Arelease)


## Supported versions and respective Dockerfiles
Expand All @@ -17,33 +17,108 @@ GitHub release(latest): ![last-release-date](https://img.shields.io/github/relea
| ------- | -------------- | -------------- | ----------- | ----------- |
{{- range $key, $value := .Json.versions }}
{{- if ne $key "" }}
| {{ if $.Json.meta.refurl }}[{{ $.Json.meta.name }}]({{ $.Json.meta.refurl }}){{ else }}{{ $.Json.meta.name }}{{ end }} | ![{{ $.Json.meta.name }}](https://img.shields.io/badge/{{ $key }}-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/{{ $.Json.meta.name }}/{{ $key }}) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/{{ $.Json.meta.name }}/{{ $key }}) | _([`{{ $key }}`{{ with $value.majorversion }}, `{{ . }}`{{ end }}{{ with $value.latest }}, `latest`{{ end }}](https://github.com/gearboxworks/docker-{{ $.Json.meta.name }}/blob/master/{{ $value.majorversion }}/DockerfileRuntime))_ |
| {{ if $.Json.meta.refurl }}[{{ $.Json.meta.name }}]({{ $.Json.meta.refurl }}){{ else }}{{ $.Json.meta.name }}{{ end }} | ![{{ $.Json.meta.name }}](https://img.shields.io/badge/{{ $key }}-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}/{{ $key }})](https://hub.docker.com/repository/docker/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}) | [![Docker Size](https://img.shields.io/docker/image-size/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}/{{ $key }})](https://hub.docker.com/repository/docker/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}) | _([`{{ $key }}`{{ with $value.majorversion }}, `{{ . }}`{{ end }}{{ with $value.latest }}, `latest`{{ end }}](https://github.com/{{ $.Json.meta.organization }}/docker-{{ $.Json.meta.name }}/blob/master/versions/{{ $key }}/DockerfileRuntime))_ |
{{- end }}
{{- end }}
{{- else }}
| Service | GitHub Version | Docker Version | Docker Size | Docker Tags |
| ------- | -------------- | -------------- | ----------- | ----------- |
{{- range $key, $value := .Json.versions }}
{{- if ne $key "" }}
| {{ if $.Json.meta.refurl }}[{{ $.Json.meta.name }}]({{ $.Json.meta.refurl }}){{ else }}{{ $.Json.meta.name }}{{ end }} | ![{{ $.Json.meta.name }}](https://img.shields.io/badge/{{ $.Json.meta.name }}-{{ $key }}-green.svg) | ![Docker Version)](https://img.shields.io/docker/v/gearboxworks/{{ $.Json.meta.name }}/{{ $key }}) | ![Docker Size](https://img.shields.io/docker/image-size/gearboxworks/{{ $.Json.meta.name }}/{{ $key }}) | _([`{{ $key }}`{{ with $value.majorversion }}, `{{ . }}`{{ end }}{{ with $value.latest }}, `latest`{{ end }}](https://github.com/gearboxworks/docker-{{ $.Json.meta.name }}/blob/master/{{ $value.majorversion }}/DockerfileRuntime))_ |
| {{ if $.Json.meta.refurl }}[{{ $.Json.meta.name }}]({{ $.Json.meta.refurl }}){{ else }}{{ $.Json.meta.name }}{{ end }} | ![{{ $.Json.meta.name }}](https://img.shields.io/badge/{{ $.Json.meta.name }}-{{ $key }}-green.svg) | [![Docker Version)](https://img.shields.io/docker/v/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}/{{ $key }})](https://hub.docker.com/repository/docker/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}) | [![Docker Size](https://img.shields.io/docker/image-size/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}/{{ $key }})](https://hub.docker.com/repository/docker/{{ $.Json.meta.organization }}/{{ $.Json.meta.name }}) | _([`{{ $key }}`{{ with $value.majorversion }}, `{{ . }}`{{ end }}{{ with $value.latest }}, `latest`{{ end }}](https://github.com/{{ $.Json.meta.organization }}/docker-{{ $.Json.meta.name }}/blob/master/versions/{{ $key }}/DockerfileRuntime))_ |
{{- end }}
{{- end }}
{{- end }}


## About this container.
A driving force behind [Gearbox](https://github.com/gearboxworks/) is to improve the user experience using software, and especially for software developers.

Our vision is to empower developers and other software users to quickly and easily use almost any version of a software service, command line tool or API without without first getting bogged down with installation and configuration.

In other words, our vision for [Gearbox](https://github.com/gearboxworks/) users is that software "**just works**".


## Using this container.
This container has been designed to work within the [Gearbox](https://github.com/gearboxworks/)
framework.
This container has been designed to work within the [Gearbox](https://github.com/gearboxworks/) framework.
However, due to the flexability of Gearbox, it can be used outside of this framework.
You can either use it directly from DockerHub or GitHub.

There are three methods:

## Method 1: Using gb-launch
`gb-launch` is a tool specifically designed to interact with a Gearbox Docker container.

It provides three important functional areas, without any Docker container learning curve:
- Allows control over Gearbox Docker containers: stop, start, create, remove.
- Build, update, modify and release Docker images.
- Acts as a proxy for interactive commands within a Gearbox Docker container.

It also provides a functional SSH daemon for connecting remotely as well as a standard set of common tools and utilities.

## Method 1: GitHub repo

### Setup from GitHub repo
`gb-launch` is currently in beta testing and is included along with all Gearbox Docker repos.
Once out of beta, it will be included within the Gearbox installation package.

For now, simply clone this repository to your local machine.

`git clone https://github.com/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}.git`

### Running gb-launch
There are many ways to call gb-launch, either directly or indirectly.
Additionally, all host environment variables will be imported into the container seamlessly.
This allows a devloper to try multiple versions of software as though they were installed locally.

If a container is missing, it will be downloaded and created. Multiple versions can co-exist.

Create, and start the {{ .Json.meta.name }} Gearbox container.

`./bin/gb-launch -gb-name {{ .Json.meta.name }}`

Create, and start the {{ .Json.meta.name }} Gearbox container. Run a shell.

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-shell`

{{- $vk := keys .Json.versions }}{{- $pv := index $vk 0 }}

Create, and start the {{ .Json.meta.name }} Gearbox container with version {{ $pv }} and run a shell.

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-version {{ $pv }} -gb-shell`

If {{ .Json.meta.name }} is symlinked to `gb-launch`, then you can drop the `-gb-name` flag.

`./bin/{{ .Json.meta.name }}`

Running {{ .Json.meta.name }} Gearbox container default command. If a container has a default interactive command, arguments can be supplied without specifying that command.

`./bin/{{ .Json.meta.name }} -flag1 -flag2 variable`

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-version {{ $pv }} -flag1 -flag2 variable`


Running alternate commands within the {{ .Json.meta.name }} Gearbox container.

`./bin/{{ .Json.meta.name }} -gb-shell -- ls -l`

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-version {{ $pv }} -gb-shell -- ls -l`

`./bin/{{ .Json.meta.name }} -gb-shell -- ps -eaf`

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-version {{ $pv }} -gb-shell -- ps -eaf`


ssh - All [Gearbox](https://github.com/gearboxworks/) containers have a running SSH daemon. So you can connect remotely.
To show what ports are exported to the host.

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-list`


## Method 2: GitHub repo

### Setup from GitHub repo
Simply clone this repository to your local machine

`git clone https://github.com/gearboxworks/{{ .Json.meta.name }}-docker.git`
`git clone https://github.com/{{ $.Json.meta.organization }}/docker-{{ .Json.meta.name }}.git`

### Building from GitHub repo
`make build` - Build Docker images. Build all versions from the base directory or specific versions from each directory.
Expand All @@ -70,7 +145,7 @@ You can either build your container as above, or use it from DockerHub with thes
`make test` - Will issue a `stop`, `rm`, `clean`, `build`, `create` and `start` on a Docker container.


## Method 2: Docker Hub
## Method 3: Docker Hub

### Setup from Docker Hub
A simple `docker pull gearbox/{{ .Json.meta.name }}` will pull down the latest version.
Expand Down Expand Up @@ -103,6 +178,9 @@ shell - Run a shell, (/bin/bash), within a Docker container.
### SSH
ssh - All [Gearbox](https://github.com/gearboxworks/) containers have a running SSH daemon. So you can connect remotely.

Either use `gb-launch` above or discover the port and SSH directly.


```
SSH_PORT="$(docker port {{ .Json.meta.name }}-latest 22/tcp | sed 's/0.0.0.0://')"
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no gearbox@localhost
Expand Down
Loading

0 comments on commit ada8808

Please sign in to comment.