Merge pull request #1128 from progrium/1091_mh-switch-to-herokuish

switching to herokuish. closes #1091
This commit is contained in:
Michael Hobbs
2015-08-24 12:11:05 -07:00
20 changed files with 131 additions and 124 deletions

View File

@@ -32,14 +32,14 @@ chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
```
## Custom buildstep build
## Custom herokuish build
Dokku ships with a pre-built version of version of the [buildstep](https://github.com/progrium/buildstep) component by default. If you want to build your own version you can specify that with an env variable.
Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable.
```shell
git clone https://github.com/progrium/dokku.git
cd dokku
sudo BUILD_STACK=true STACK_URL=https://github.com/progrium/buildstep.git make install
sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
```
## Configuring

View File

@@ -25,7 +25,7 @@ You're done!
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
Right now Buildstep supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/progrium/buildstep#supported-buildpacks). It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)!
Right now Herokuish supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/gliderlabs/herokuish#buildpacks).
Please check the documentation for your particular build pack as you may need to include configuration files (such as a Procfile) in your project root.
## Deploying to server over SSH
@@ -48,7 +48,7 @@ ssh -T git@github.com
## Specifying a custom buildpack
If buildpack detection isn't working well for you or you want to specify a custom buildpack for one repository you can create & commit a file in the root of your git repository named `.env` containing `export BUILDPACK_URL=<repository>` before pushing. This will tell buildstep to fetch the specified buildpack and use it instead of relying on the built-in buildpacks & their detection methods.
If buildpack detection isn't working well for you or you want to specify a custom buildpack for one repository you can create & commit a file in the root of your git repository named `.env` containing `export BUILDPACK_URL=<repository>` before pushing. This will tell herokuish to fetch the specified buildpack and use it instead of relying on the built-in buildpacks & their detection methods.
## Dockerfile deployment

View File

@@ -53,7 +53,7 @@ ATTEMPTS=6
git push dokku master
-----> Cleaning up...
-----> Building myapp from buildstep...
-----> Building myapp from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rails
@@ -71,13 +71,13 @@ git push dokku master
http://localhost/check.txt => "simple_check"
!
curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
! Check attempt 1/6 failed.
! Check attempt 1/6 failed.
-----> Attempt 2/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/check.txt => "simple_check"
!
curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
! Check attempt 2/6 failed.
! Check attempt 2/6 failed.
-----> Attempt 3/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/check.txt => "simple_check"
@@ -124,7 +124,7 @@ ATTEMPTS=6
git push dokku master
-----> Cleaning up...
-----> Building myapp from buildstep...
-----> Building myapp from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rails
@@ -142,38 +142,38 @@ Running pre-flight checks
http://localhost/ => ""
!
curl: (7) Failed to connect to 172.17.0.188 port 5000: Connection refused
! Check attempt 1/6 failed.
! Check attempt 1/6 failed.
-----> Attempt 2/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
!
curl: (7) Failed to connect to 172.17.0.188 port 5000: Connection refused
! Check attempt 2/6 failed.
! Check attempt 2/6 failed.
-----> Attempt 3/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 3/6 failed.
! Check attempt 3/6 failed.
-----> Attempt 4/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 4/6 failed.
! Check attempt 4/6 failed.
-----> Attempt 5/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 5/6 failed.
! Check attempt 5/6 failed.
-----> Attempt 6/6 Waiting for 5 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
!
curl: (22) The requested URL returned error: 500 Internal Server Error
Could not start due to 1 failed checks.
! Check attempt 6/6 failed.
! Check attempt 6/6 failed.
=====> myapp container output:
=> Booting Thin
=> Rails 4.2.0 application starting in production on http://0.0.0.0:5000

View File

@@ -1,7 +1,7 @@
# Components
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
* [Buildstep](https://github.com/progrium/buildstep) - Buildpack builder
* [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder
* [pluginhook](https://github.com/progrium/pluginhook) - Shell based plugins and hooks
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH

View File

@@ -83,7 +83,7 @@ esac
```shell
#!/usr/bin/env bash
# Update the buildstep image from git source
# Update the herokuish image from git source
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
@@ -180,9 +180,9 @@ for file in */REDIRECT; do
done
```
### `pre-build-buildstep`
### `pre-build-buildpack`
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildstep.
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildpacks.
- Invoked by: `dokku build`
- Arguments: `$APP`
- Example:
@@ -195,9 +195,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-build-buildstep`
### `post-build-buildpack`
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildstep.
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildpacks.
- Invoked by: `dokku build`
- Arguments: `$APP`
- Example:
@@ -240,9 +240,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `pre-release-buildstep`
### `pre-release-buildpack`
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildstep.
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
- Invoked by: `dokku release`
- Arguments: `$APP`
- Example:
@@ -266,9 +266,9 @@ test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null
```
### `post-release-buildstep`
### `post-release-buildpack`
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildstep.
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
- Invoked by: `dokku release`
- Arguments: `$APP`
- Example:

View File

@@ -27,9 +27,9 @@ A value of 64 would allow domains with up to 64 characters. Set it to 128 if you
Save the file and try stopping nginx and starting it again:
```
root@dockerapps:~/dokku/buildstep# /etc/init.d/nginx stop
root@dockerapps:~/dokku# /etc/init.d/nginx stop
* Stopping nginx nginx [ OK ]
root@dockerapps:~/dokku/buildstep# /etc/init.d/nginx start
root@dockerapps:~/dokku# /etc/init.d/nginx start
* Starting nginx nginx [ OK ]
```
@@ -65,8 +65,8 @@ __Solution (Less solution, more helpful troubleshooting steps):__
Find the failed phase's container image (*077581956a92* in this example)
```
root@dokku:~# docker ps -a | grep builder
94d9515e6d93 077581956a92 "/build/builder" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
root@dokku:~# docker ps -a | grep build
94d9515e6d93 077581956a92 "/build" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
```
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
@@ -109,26 +109,6 @@ Also see [issue #116](https://github.com/progrium/dokku/issues/116)
***
__Symptom:__ I want to deploy my nodejs app on dokku and use a postinstall script within the package.json but I keep getting this error:
npm WARN cannot run in wd app@1.0.0 echo blah (wd=/build/app)
__Solution:__
This is a permissions problem as dokku (buildstep) uses a root account for running the application. (This may change please see this thread: https://github.com/progrium/buildstep/pull/42).
To allow npm to work as root account one must set the configuration option of ```unsafe-perm``` to true. There are many ways to set this configuration option but the one I've found works most consistently with the heroku-nodejs-buildpack is as a .npmrc file. The file should contain
```
unsafe-perm = true
```
Note that this is NOT required on heroku as heroku does not use a root account for running the application.
Please see https://github.com/progrium/dokku/issues/420 and https://github.com/heroku/heroku-buildpack-nodejs/issues/92.
***
__Symptom:__ I successfully deployed my application with no deployment errors and receiving Bad Gateway when attempting to access the application
__Solution:__

View File

@@ -37,26 +37,26 @@ All changes will take effect upon next application deployment. To trigger a rebu
dokku ps:rebuildall
```
## Buildstep image
## Herokuish image
If dokku was installed via a debian package, you can upgrade buildstep via the following command:
If dokku was installed via a debian package, you can upgrade herokuish via the following command:
```shell
sudo apt-get install buildstep
sudo apt-get install Herokush
```
For unattended upgrades, you may run the following command:
```shell
sudo apt-get install -qq -y buildstep
sudo apt-get install -qq -y herokuish
```
In some cases, it may be desirable to run a specific version of buildstep. To install/upgrade buildstep from source, run the following commands:
In some cases, it may be desirable to run a specific version of herokuish. To install/upgrade herokuish from source, run the following commands:
```shell
cd /tmp
git clone https://github.com/progrium/buildstep.git
cd buildstep
git clone https://github.com/gliderlabs/herokuish.git
cd herokuish
git pull origin master
sudo make build
IMAGE_NAME=gliderlabs/herokuish BUILD_TAG=latest VERSION=master make -e build-in-docker
```