Skip to content

Commit

Permalink
Rebuild with docker-template v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MickMake committed May 6, 2020
1 parent 4297fbb commit e513368
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 98 deletions.
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ However, due to the flexability of Gearbox, it can be used outside of this frame

There are three methods:

## Method 1: Using gb-launch
`gb-launch` is a tool specifically designed to interact with a Gearbox Docker container.
## Method 1: Using launch
`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.
Expand All @@ -41,60 +41,63 @@ It provides three important functional areas, without any Docker container learn

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

Further `launch` documentation can be [found here](https://github.com/gearboxworks/docker-template/blob/master/LAUNCH.md).

### Setup from GitHub repo
`gb-launch` is currently in beta testing and is included along with all Gearbox Docker repos.
### Download launch
`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.
For now, simply download the standalone `launch` binary for your O/S.
- [Mac OSX 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Darwin/launch)
- [Linux 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Linux/launch)
- [Windows 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Windows/launch)

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

### Running gb-launch
There are many ways to call gb-launch, either directly or indirectly.
### Running launch
There are many ways to call 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 mailhog Gearbox container.
Install, create, and start the mailhog Gearbox container.

`./bin/gb-launch -gb-name mailhog`
`./launch install mailhog`

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

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

Create, and start the mailhog Gearbox container with version 1.0.0 and run a shell.

`./bin/gb-launch -gb-name mailhog -gb-version 1.0.0 -gb-shell`

If mailhog is symlinked to `gb-launch`, then you can drop the `-gb-name` flag.
`./launch shell mailhog:1.0.0`

`./bin/mailhog`
`./launch shell mailhog:1.0.0 ls -l`

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

`./bin/mailhog -flag1 -flag2 variable`
`./launch shell mailhog:1.0.0 ps -eaf`

`./bin/gb-launch -gb-name mailhog -gb-version 1.0.0 -flag1 -flag2 variable`

### Available commands
If mailhog is symlinked to `launch`, then the Gearbox container will be determined automatically and the default command will be run.
All available commands for a Gearbox container will be automatically symlinked upon installation.

Running alternate commands within the mailhog Gearbox container.
`./mailhog`

`./bin/mailhog -gb-shell -- ls -l`
Running mailhog Gearbox container default command. If a container has a default interactive command, arguments can be supplied without specifying that command.

`./bin/gb-launch -gb-name mailhog -gb-version 1.0.0 -gb-shell -- ls -l`
`./mailhog -flag1 -flag2 variable`

`./bin/mailhog -gb-shell -- ps -eaf`
`./launch mailhog:1.0.0 -flag1 -flag2 variable`

`./bin/gb-launch -gb-name mailhog -gb-version 1.0.0 -gb-shell -- ps -eaf`
Gearbox containers may have multiple executables that can be run. The mailhog Gearbox container has the following available commands:
- The default command will execute `` within the container.


### Remote connection
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.
To show what ports are exported to the host, use the following command.

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


## Method 2: GitHub repo
Expand Down Expand Up @@ -162,7 +165,7 @@ 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.
Either use `launch` above or discover the port and SSH directly.


```
Expand Down
66 changes: 38 additions & 28 deletions TEMPLATE/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ GitHub release(latest): ![last-release-date](https://img.shields.io/github/relea
{{- end }}
{{- end }}

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


## 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.
Expand All @@ -45,8 +47,8 @@ However, due to the flexability of Gearbox, it can be used outside of this frame

There are three methods:

## Method 1: Using gb-launch
`gb-launch` is a tool specifically designed to interact with a Gearbox Docker container.
## Method 1: Using launch
`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.
Expand All @@ -55,62 +57,70 @@ It provides three important functional areas, without any Docker container learn

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

Further `launch` documentation can be [found here](https://github.com/gearboxworks/docker-template/blob/master/LAUNCH.md).

### Setup from GitHub repo
`gb-launch` is currently in beta testing and is included along with all Gearbox Docker repos.
### Download launch
`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.
For now, simply download the standalone `launch` binary for your O/S.
- [Mac OSX 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Darwin/launch)
- [Linux 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Linux/launch)
- [Windows 64bit](https://github.com/gearboxworks/docker-template/raw/master/bin/Windows/launch)

`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.
### Running launch
There are many ways to call 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.
Install, create, and start the {{ .Json.meta.name }} Gearbox container.

`./bin/gb-launch -gb-name {{ .Json.meta.name }}`
`./launch install {{ .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 }}
`./launch shell {{ .Json.meta.name }}`

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`
`./launch shell {{ .Json.meta.name }}:{{ $pv }}`

If {{ .Json.meta.name }} is symlinked to `gb-launch`, then you can drop the `-gb-name` flag.
`./launch shell {{ .Json.meta.name }}:{{ $pv }} ls -l`

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

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`
### Available commands
If {{ .Json.meta.name }} is symlinked to `launch`, then the Gearbox container will be determined automatically and the default command will be run.
All available commands for a Gearbox container will be automatically symlinked upon installation.

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

Running alternate commands within the {{ .Json.meta.name }} Gearbox container.
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 }} -gb-shell -- ls -l`
`./{{ .Json.meta.name }} -flag1 -flag2 variable`

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

`./bin/{{ .Json.meta.name }} -gb-shell -- ps -eaf`
Gearbox containers may have multiple executables that can be run. The {{ .Json.meta.name }} Gearbox container has the following available commands:

`./bin/gb-launch -gb-name {{ .Json.meta.name }} -gb-version {{ $pv }} -gb-shell -- ps -eaf`
{{- range $key, $value := .Json.run.commands }}
{{- if eq $key "default" }}
- The default command will execute `{{ $value }}` within the container.
{{- else }}
- `{{ $key }}` - will execute `{{ $value }}` within the container.
{{- end }}
{{- end }}


### Remote connection
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.
To show what ports are exported to the host, use the following command.

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


## Method 2: GitHub repo
Expand Down Expand Up @@ -178,7 +188,7 @@ 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.
Either use `launch` above or discover the port and SSH directly.


```
Expand Down
1 change: 1 addition & 0 deletions bin/Darwin/.-1.0.0
Binary file modified bin/Darwin/launch
Binary file not shown.
Binary file modified bin/Linux/launch
Binary file not shown.
1 change: 1 addition & 0 deletions bin/TemplateUpdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ else
echo "# Gearbox[docker-template]: Cannot find docker-template repository."
fi

make init
Binary file added bin/Windows/launch.exe
Binary file not shown.
7 changes: 1 addition & 6 deletions bin/_Functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ gb_getenv() {
GB_VERDIR="${GB_BASEDIR}/versions/$1"
export GB_VERDIR

#if [ ! -d "${GB_VERDIR}" ]
#then
# mkdir -p "${GB_VERDIR}"
#fi

if [ -f "TEMPLATE/version/.env.tmpl" ]
then
${GB_BINFILE} -json "${GB_JSONFILE}" -template "TEMPLATE/version/.env.tmpl" -out "${GB_VERDIR}/.env"
Expand Down Expand Up @@ -235,7 +230,7 @@ gb_create-version() {

for GB_VERSION in ${GB_VERSIONS}
do
if [ -d ${GB_VERDIR} ]
if [ -d "${GB_BASEDIR}/versions/${GB_VERSION}" ]
then
gb_getenv ${GB_VERSION}
p_info "${FUNCNAME[0]}" "Updating version directory \"${GB_VERSION}\"."
Expand Down
3 changes: 3 additions & 0 deletions build/gearbox-mailhog.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"restart": "--restart always"
},
"run": {
"commands": {
"default": ""
}
},
"project": {
},
Expand Down
7 changes: 5 additions & 2 deletions gearbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
"restart": "--restart always"
},
"run": {
"commands": {
"default": "/usr/local/bin/mhsendmail",
"mhsendmail": "/usr/local/bin/mhsendmail"
}
},
"project": {
},
Expand All @@ -40,7 +44,6 @@
"latest": true,
"ref": "",
"base": "gearboxworks/gearbox-base:alpine-3.10"
},
"": {}
}
}
}
32 changes: 0 additions & 32 deletions gearbox.json-OLD

This file was deleted.

2 changes: 1 addition & 1 deletion versions/1.0.0/.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GB_REF=''; export GB_REF

GB_DOCKERFILE='versions/1.0.0/DockerfileRuntime'; export GB_DOCKERFILE
# GB_JSONFILE='1.0.0/gearbox.json'; export GB_JSONFILE
GB_JSON='{"schema": "gear-1","meta": {"state": "production","organization": "gearboxworks","name": "mailhog","label": "Mailhog","maintainer": "Gearbox Team <team@gearbox.works>","class": "system","refurl": "https://github.com/mailhog/MailHog"},"build": {"ports": {"http": "80","smtp": "25"},"run": "/usr/local/bin/MailHog","args": "","env": {"MH_API_BIND_ADDR": "0.0.0.0:80","MH_HOSTNAME": "mailhog.gearboxworks.io","MH_SMTP_BIND_ADDR": "0.0.0.0:25","MH_UI_BIND_ADDR": "0.0.0.0:80"},"network": "--network gearboxnet","volumes": "","restart": "--restart always"},"run": {},"project": {},"extensions": {},"versions": {"1.0.0": {"majorversion": "1.0","latest": true,"ref": "","base": "gearboxworks/gearbox-base:alpine-3.10"},"": {}}}'; export GB_JSON
GB_JSON='{"schema": "gear-1","meta": {"state": "production","organization": "gearboxworks","name": "mailhog","label": "Mailhog","maintainer": "Gearbox Team <team@gearbox.works>","class": "system","refurl": "https://github.com/mailhog/MailHog"},"build": {"ports": {"http": "80","smtp": "25"},"run": "/usr/local/bin/MailHog","args": "","env": {"MH_API_BIND_ADDR": "0.0.0.0:80","MH_HOSTNAME": "mailhog.gearboxworks.io","MH_SMTP_BIND_ADDR": "0.0.0.0:25","MH_UI_BIND_ADDR": "0.0.0.0:80"},"network": "--network gearboxnet","volumes": "","restart": "--restart always"},"run": {"commands": {"default": "/usr/local/bin/mhsendmail","mhsendmail": "/usr/local/bin/mhsendmail"}},"project": {},"extensions": {},"versions": {"1.0.0": {"majorversion": "1.0","latest": true,"ref": "","base": "gearboxworks/gearbox-base:alpine-3.10"}}}'; export GB_JSON

GB_IMAGENAME='gearboxworks/mailhog'; export GB_IMAGENAME
GB_IMAGEVERSION='gearboxworks/mailhog:1.0.0'; export GB_IMAGEVERSION
Expand Down
4 changes: 2 additions & 2 deletions versions/1.0.0/DockerfileRuntime
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

################################################################################
# WARNING: This file has been auto-generated. DO NOT EDIT: WARNING
# Created on 2020-04-03T18:46:05+1100, using template:DockerfileRuntime.tmpl and json:gearbox.json
# Created on 2020-05-06T19:09:04+1000, using template:DockerfileRuntime.tmpl and json:gearbox.json
# Plain Docker container for docker-mailhog based off gearboxworks/gearbox-base:alpine-3.10

ARG VERSION=1.0.0
Expand All @@ -18,7 +18,7 @@ ENV GEARBOX_CONTAINER_NAME "docker-mailhog"
ENV GEARBOX_CONTAINER_VERSION ${VERSION}
ENV GEARBOX_ENTRYPOINT ${GEARBOX_ENTRYPOINT}
ENV GEARBOX_ENTRYPOINT_ARGS ${GEARBOX_ENTRYPOINT_ARGS}
LABEL gearbox.json='{"schema": "gear-1","meta": {"state": "production","organization": "gearboxworks","name": "mailhog","label": "Mailhog","maintainer": "Gearbox Team <team@gearbox.works>","class": "system","refurl": "https://github.com/mailhog/MailHog"},"build": {"ports": {"http": "80","smtp": "25"},"run": "/usr/local/bin/MailHog","args": "","env": {"MH_API_BIND_ADDR": "0.0.0.0:80","MH_HOSTNAME": "mailhog.gearboxworks.io","MH_SMTP_BIND_ADDR": "0.0.0.0:25","MH_UI_BIND_ADDR": "0.0.0.0:80"},"network": "--network gearboxnet","volumes": "","restart": "--restart always"},"run": {},"project": {},"extensions": {},"versions": {"1.0.0": {"majorversion": "1.0","latest": true,"ref": "","base": "gearboxworks/gearbox-base:alpine-3.10"},"": {}}}'
LABEL gearbox.json='{"schema": "gear-1","meta": {"state": "production","organization": "gearboxworks","name": "mailhog","label": "Mailhog","maintainer": "Gearbox Team <team@gearbox.works>","class": "system","refurl": "https://github.com/mailhog/MailHog"},"build": {"ports": {"http": "80","smtp": "25"},"run": "/usr/local/bin/MailHog","args": "","env": {"MH_API_BIND_ADDR": "0.0.0.0:80","MH_HOSTNAME": "mailhog.gearboxworks.io","MH_SMTP_BIND_ADDR": "0.0.0.0:25","MH_UI_BIND_ADDR": "0.0.0.0:80"},"network": "--network gearboxnet","volumes": "","restart": "--restart always"},"run": {"commands": {"default": ""}},"project": {},"extensions": {},"versions": {"1.0.0": {"majorversion": "1.0","latest": true,"ref": "","base": "gearboxworks/gearbox-base:alpine-3.10"}}}'
LABEL gearbox.version='1.0.0'
ENV GEARBOX_VERSION "1.0.0"
LABEL container.class="system"
Expand Down

0 comments on commit e513368

Please sign in to comment.