Compare commits

...

114 Commits

Author SHA1 Message Date
Dokku Bot
9d883f53c7 Release 0.25.6
# History

## 0.25.6

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.6/bootstrap.sh
sudo DOKKU_TAG=v0.25.6 bash bootstrap.sh
```

### Bug Fixes

- #4841: @josegonzalez Ensure pack is run as root user when building apps in docker
- #4836: @josegonzalez Fix custom dockerfile path detection
- #4839: @josegonzalez Choose the correct app when a named remote is specified in the remote ssh client

### New Features

- #4829: @josegonzalez Add ability to schedule process types in parallel
- #4837: @josegonzalez Filter --link and --volume flags during Dockerfile builds

### Documentation

- #4840: @josegonzalez Explain sha256 image digest alternative when reusing docker image tags for git:from-image deployments

### Tests

- #4842: @josegonzalez Set default process list in test cnb buildpacks

### Other

- #4832: @dependabot[bot] chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/python-flask
- #4833: @dependabot[bot] chore(deps): bump jinja2 from 3.0.1 to 3.0.2 in /tests/apps/python-flask
- #4831: @dependabot[bot] chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/multi
2021-10-06 08:58:30 +00:00
Jose Diaz-Gonzalez
a25071f02f Merge pull request #4842 from dokku/fix-pack-tests
Set default process list in test cnb buildpacks
2021-10-06 03:59:28 -04:00
Jose Diaz-Gonzalez
5f5efe2563 Merge pull request #4829 from dokku/parallel-container-scheduling
Add ability to schedule process types in parallel
2021-10-06 03:51:26 -04:00
Jose Diaz-Gonzalez
fa1f3d0a08 Merge pull request #4841 from dokku/pack-in-docker
Ensure pack is run as root user when building apps in docker
2021-10-06 03:50:47 -04:00
Jose Diaz-Gonzalez
0720c3ef66 Merge pull request #4836 from dokku/4830-fix-dockerfile-detection
Fix custom dockerfile path detection
2021-10-06 03:30:05 -04:00
Jose Diaz-Gonzalez
ea86a9f2ca fix: ensure pack is run as root user when building apps in docker
Without this, using the pack builder fails since it cannot communicate with a root-mounted docker socket.
2021-10-06 03:07:40 -04:00
Jose Diaz-Gonzalez
4cf717baf8 fix: set default process list in test buildpacks
Also include the packeto-buildpacks/procfile buildpack to ensure the Procfile is interpolated for a process list.
2021-10-06 03:06:54 -04:00
Jose Diaz-Gonzalez
bab3e714f7 feat: require parallel package 2021-10-06 02:04:22 -04:00
Jose Diaz-Gonzalez
74b2961f8d fix: correct shfmt issues 2021-10-06 02:04:22 -04:00
Jose Diaz-Gonzalez
76201aed64 feat: add ability to deploy process types in parallel 2021-10-06 02:04:21 -04:00
Jose Diaz-Gonzalez
9e27b07772 refactor: split out docker-local scheduler deploys into separate binaries
This will allow those binaries to run in parallel.
2021-10-06 02:04:21 -04:00
Jose Diaz-Gonzalez
51c5c58354 fix: do not attempt to move the Dockerfile if it is the default path
Also drop the unnecessary rm call
2021-10-06 02:03:39 -04:00
Jose Diaz-Gonzalez
2d1b93c354 Merge pull request #4837 from dokku/filter-link
Filter --link and --volume flags during Dockerfile builds
2021-10-06 02:00:23 -04:00
Jose Diaz-Gonzalez
f945696d15 Merge pull request #4839 from dokku/4838-client-remote
Choose the correct app when a named remote is specified in the remote ssh client
2021-10-06 02:00:08 -04:00
Jose Diaz-Gonzalez
4687b96003 Merge pull request #4840 from dokku/josegonzalez-patch-1
Explain sha256 image digest alternative when reusing docker image tags for git:from-image deployments
2021-10-05 13:48:37 -04:00
Jose Diaz-Gonzalez
92524c2da0 docs: explain sha256 image digest alternative when reusing docker image tags for git:from-image deployments 2021-10-05 13:48:12 -04:00
Jose Diaz-Gonzalez
a5ea0ba896 Merge pull request #4832 from dokku/dependabot/pip/tests/apps/python-flask/flask-2.0.2
chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/python-flask
2021-10-05 13:35:28 -04:00
Jose Diaz-Gonzalez
b7c7155852 fix: choose the correct app when a named remote is specified in the remote ssh client
Closes #4838
2021-10-05 13:18:19 -04:00
Jose Diaz-Gonzalez
fd28bf53de fix: move custom dockerfiles into place during the core-post-extract phase
Closes #4830
2021-10-05 12:21:29 -04:00
Jose Diaz-Gonzalez
52d9cb6188 fix: filter link and volume flags for dockerfile builds
The link flag was previously not filtered _after_ fetching build args for dockerfile builds, which meant if a plugin exposed that in it's own docker-args-build trigger, it would break deploys.

Additionally, allow for whitespaces between link and volume flags.
2021-10-05 12:20:34 -04:00
dependabot[bot]
5dcdce8b62 chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/python-flask
Bumps [flask](https://github.com/pallets/flask) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-05 15:28:41 +00:00
Jose Diaz-Gonzalez
b41b5c0a68 Merge pull request #4833 from dokku/dependabot/pip/tests/apps/python-flask/jinja2-3.0.2
chore(deps): bump jinja2 from 3.0.1 to 3.0.2 in /tests/apps/python-flask
2021-10-05 11:28:10 -04:00
Jose Diaz-Gonzalez
a9f820bfaa Merge pull request #4831 from dokku/dependabot/pip/tests/apps/multi/flask-2.0.2
chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/multi
2021-10-05 11:27:27 -04:00
dependabot[bot]
a2e40de597 chore(deps): bump jinja2 from 3.0.1 to 3.0.2 in /tests/apps/python-flask
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.1...3.0.2)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-05 13:09:34 +00:00
dependabot[bot]
2fa7baa035 chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/multi
Bumps [flask](https://github.com/pallets/flask) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-05 13:09:24 +00:00
Dokku Bot
177f0be21c Release 0.25.5
# History

## 0.25.5

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.5/bootstrap.sh
sudo DOKKU_TAG=v0.25.5 bash bootstrap.sh
```

### Bug Fixes

- #4787: @josegonzalez Do not require double quotes when issuing dokku run commands
- #4816: @josegonzalez Set the DOKKU_HOST_ROOT on docker container start
- #4810: @josegonzalez Handle udp ports when fetching network config
- #4812: @josegonzalez Silence stderr when fetching a command from the Procfile
- #4800: @josegonzalez Add help2man os package for copyfiles make target to devcontainer
- #4796: @josegonzalez Remove the --restart flag from pre-deploy chown containers

### New Features

- #4809: @josegonzalez Implement storage:ensure-directory command
- #4801: @josegonzalez Expose git-from-archive and git-from-image plugin triggers
- #4785: @josegonzalez Add support for VSCode Dev Containers

### Documentation

- #4819: @stephenheron Fixed typo in tar documentation
- #4824: @dy3l Fix GitLab case
- #4822: @josegonzalez Add a note about using the registry:login command for private image deployments
- #4808: @francipvb Added a comment about Dockerfile deployment
- #4807: @FinnWoelm Docs: Fix instructions for enabling Docker Buildkit
- #4786: @josegonzalez Add missing argument from trigger documentation
- #4780: @adam12 Update source for `dokku-update`

### Tests

- #4828: @josegonzalez Update golang in test apps to latest version
- #4815: @josegonzalez tests: use python3 shebang for shellcheck-to-junit script
- #4814: @josegonzalez Add wget to devcontainer to fix shfmt installation
- #4791: @josegonzalez Fix test running in devcontainer

### Other

- #4813: @dependabot[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 197 to 198 in /tests/apps/php
- #4802: @dependabot[bot] chore(deps): bump django from 3.1.12 to 3.1.13 in /tests/apps/dockerfile-release
- #4784: @josegonzalez Upgrade vector image to 0.16.x
2021-10-05 01:42:35 +00:00
Jose Diaz-Gonzalez
c29def79f3 Merge pull request #4828 from dokku/update-golang
Update golang in test apps to latest version
2021-10-04 01:30:09 -04:00
Jose Diaz-Gonzalez
8fb50bbf68 tests: update golang in test apps to latest version 2021-10-04 00:46:45 -04:00
Jose Diaz-Gonzalez
ed9d356f60 Merge pull request #4787 from dokku/fix-run-quoting
Do not require double quotes when issuing dokku run commands
2021-10-03 23:35:24 -04:00
Jose Diaz-Gonzalez
a4be3a06f9 fix: properly quote arguments so that they preserve whitespace 2021-10-03 22:56:25 -04:00
Jose Diaz-Gonzalez
e636609fa8 fix: declare RUN_COMMAND after all other argument parsing has been performed
If it is declared sooner, the transformation of the command to the Procfile entry will be ignored.
2021-10-03 22:42:06 -04:00
Jose Diaz-Gonzalez
1d1cf56692 fix: run shfmt 2021-10-03 22:31:05 -04:00
Jose Diaz-Gonzalez
82778a0aad Merge pull request #4816 from dokku/josegonzalez-patch-2
Set the DOKKU_HOST_ROOT on docker container start
2021-10-03 22:30:13 -04:00
Jose Diaz-Gonzalez
3d239344fe refactor: use eval set hack to preserve whitespace 2021-10-03 20:09:16 -04:00
Jose Diaz-Gonzalez
c266d8c41e chore: ignore shellcheck issues 2021-10-03 20:08:56 -04:00
Jose Diaz-Gonzalez
6f2c218f29 chore: fix shfmt issue 2021-10-03 19:47:54 -04:00
Jose Diaz-Gonzalez
abfb0d3977 fix: do not require double quotes when issuing dokku run commands
This was broken in the #4736.
2021-10-03 19:46:42 -04:00
Jose Diaz-Gonzalez
9a1a97d56f docs: document DOKKU_HOST_ROOT 2021-10-03 19:45:06 -04:00
Jose Diaz-Gonzalez
44caf44ce6 fix: set the DOKKU_HOST_ROOT on docker container start
Without this change, cache doesn't work when running in a docker container.
2021-10-03 19:44:44 -04:00
Jose Diaz-Gonzalez
e800b8a9a7 Merge pull request #4815 from dokku/josegonzalez-patch-1
tests: use python3 shebang for shellcheck-to-junit script
2021-10-03 19:43:26 -04:00
Jose Diaz-Gonzalez
4d0ff4a834 Merge pull request #4810 from dokku/4804-skip-udp-port
Handle udp ports when fetching network config
2021-10-03 17:59:48 -04:00
Jose Diaz-Gonzalez
ce4fe7850b Merge pull request #4819 from stephenheron/patch-1
Fixed typo in tar documentation
2021-10-03 17:58:46 -04:00
Jose Diaz-Gonzalez
869a6ce553 Merge pull request #4824 from dy3l/fix-gitlab-case
Fix GitLab case
2021-10-01 16:21:20 -04:00
dy3l
43b90f1ae8 Fix GitLab case 2021-10-01 21:16:58 +01:00
Jose Diaz-Gonzalez
3e694926c9 Merge pull request #4822 from dokku/josegonzalez-patch-3
Add a note about using the registry:login command for private image deployments
2021-10-01 12:39:36 -04:00
Jose Diaz-Gonzalez
1c277a99cb docs: add a note about using the registry:login command for private image deployments 2021-10-01 12:39:10 -04:00
Stephen Heron
071416ef11 Fixed tar.md typo
Small typo: arhive  to archive
2021-09-30 15:57:13 +01:00
Jose Diaz-Gonzalez
5502a61452 Merge pull request #4809 from dokku/4805-ensure-directory
Implement storage:ensure-directory command
2021-09-30 01:25:33 -04:00
Jose Diaz-Gonzalez
96924e54c4 fix: decode bytes to a string 2021-09-30 01:25:05 -04:00
Jose Diaz-Gonzalez
8cff88dea0 tests: use python3 shebang for shellcheck-to-junit script 2021-09-29 12:21:58 -04:00
Jose Diaz-Gonzalez
fbff08a580 Merge pull request #4814 from dokku/josegonzalez-patch-1
Add wget to devcontainer to fix shfmt installation
2021-09-29 11:38:38 -04:00
Jose Diaz-Gonzalez
9b45aed6f0 dev: add wget to devcontainer to fix shfmt installation 2021-09-29 11:38:16 -04:00
Jose Diaz-Gonzalez
d9eea74f18 feat: implement storage:ensure-directory command
Closes #4805
2021-09-29 11:36:02 -04:00
Jose Diaz-Gonzalez
301d5a19b0 Merge pull request #4812 from dokku/silence-procfile-get-errors
Silence stderr when fetching a command from the Procfile
2021-09-29 11:32:11 -04:00
Jose Diaz-Gonzalez
8cb4bb74fa Merge pull request #4813 from dokku/dependabot/composer/tests/apps/php/heroku/heroku-buildpack-php-198
chore(deps-dev): bump heroku/heroku-buildpack-php from 197 to 198 in /tests/apps/php
2021-09-29 11:31:58 -04:00
dependabot[bot]
61447f9ffd chore(deps-dev): bump heroku/heroku-buildpack-php in /tests/apps/php
Bumps [heroku/heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) from 197 to 198.
- [Release notes](https://github.com/heroku/heroku-buildpack-php/releases)
- [Changelog](https://github.com/heroku/heroku-buildpack-php/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/heroku-buildpack-php/compare/v197...v198)

---
updated-dependencies:
- dependency-name: heroku/heroku-buildpack-php
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-29 13:11:48 +00:00
Jose Diaz-Gonzalez
06742cfcc4 fix: silence stderr when fetching a command from the Procfile
When deploying, if the procfile-get-command fails for a given process, this causes an error to output to stderr. We instead silence this as the error isn't important.
2021-09-29 00:48:26 -04:00
Jose Diaz-Gonzalez
82dfcc01e2 fix: handle udp ports when fetching network config
When an app only has UDP ports exposed, deploys will fail as we expect there to be a single TCP port.

While we _should_ support both, the easier fix is to ignore things and move on. Users can manually expose UDP ports as necessary via the -p flag (or by not specifying the port as a UDP port).

One quirk discovered during tests is that disabling zero-downtime deploys results in odd output, but also a deploy can succeed even if one of the processes that skipped zero-downtime fails. We should fix this in another PR, but this is documented in tests for now.

Closes #4804
2021-09-29 00:37:38 -04:00
Jose Diaz-Gonzalez
892391a7fd Merge pull request #4808 from francipvb/patch-1
Added a comment about Dockerfile deployment
2021-09-28 22:34:06 -04:00
Jose Diaz-Gonzalez
44a43cb130 docs: update note to clarify how port mapping works for Dockerfile apps 2021-09-28 22:25:52 -04:00
Francisco R. Del Roio
e00c98546f A comment about Dockerfile deployment.
I found issues while trying to deploy an app from a dockerfile and I found that the expose instruction causes problems with the dokku proxy.
2021-09-28 21:19:12 -03:00
Jose Diaz-Gonzalez
27e2f7ab3d Merge pull request #4807 from FinnWoelm/patch-1
Docs: Fix instructions for enabling Docker Buildkit
2021-09-28 15:14:04 -04:00
Finn Woelm
eadf9f1f8e Docs: Fix instructions for enabling Docker Buildkit
Docker Buildkit must be enabled via `/etc/default/dokku`. It cannot be enabled via `dokku config` because those variables are not made available during the `build` phase of Docker containers for security reasons (see https://dokku.com/docs/deployment/builders/dockerfiles/#build-time-configuration-variables).

See: https://github.com/dokku/dokku/pull/4723#issuecomment-927381185
2021-09-28 21:11:09 +02:00
Jose Diaz-Gonzalez
597fb7d219 Merge pull request #4801 from dokku/4778-git-hooks
Expose git-from-archive and git-from-image plugin triggers
2021-09-27 15:01:40 -04:00
Jose Diaz-Gonzalez
e27d19a346 Merge pull request #4802 from dokku/dependabot/pip/tests/apps/dockerfile-release/django-3.1.13
chore(deps): bump django from 3.1.12 to 3.1.13 in /tests/apps/dockerfile-release
2021-09-27 15:01:26 -04:00
dependabot[bot]
15bf4a8386 chore(deps): bump django in /tests/apps/dockerfile-release
Bumps [django](https://github.com/django/django) from 3.1.12 to 3.1.13.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.12...3.1.13)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-26 21:53:29 +00:00
Jose Diaz-Gonzalez
003ed01e30 Merge pull request #4784 from dokku/upgrade-vector
feat: upgrade vector image to 0.16.x
2021-09-26 17:50:02 -04:00
Jose Diaz-Gonzalez
db239debf1 feat: expose git-from-archive and git-from-image plugin triggers
This will allow other plugins to create apps on the fly by specifying either an archive url or a docker image.

Closes #4778
2021-09-22 12:32:17 -04:00
Jose Diaz-Gonzalez
fccd4e1a20 fix: add missing event hook 2021-09-22 12:31:35 -04:00
Jose Diaz-Gonzalez
0c8c093cf7 Merge pull request #4800 from dokku/help2man-devcontainer
Add help2man os package for copyfiles make target to devcontainer
2021-09-22 00:26:00 -04:00
Jose Diaz-Gonzalez
f74b702c5e fix: add os package for copyfiles make target to devcontainer
This ensures 'make copyfiles' can run appropriately within a devcontainer.
2021-09-22 00:25:16 -04:00
Jose Diaz-Gonzalez
75309bf3a0 Merge pull request #4791 from dokku/tests-in-devcontainer
Fix test running in devcontainer
2021-09-22 00:13:41 -04:00
Jose Diaz-Gonzalez
dc310c4ce4 Merge pull request #4796 from dokku/4783-drop-restart
Remove the --restart flag from pre-deploy chown containers
2021-09-22 00:13:11 -04:00
Jose Diaz-Gonzalez
0aa3c3fa53 fix: remove the --restart flag from pre-deploy chown containers
Closes #4783
2021-09-18 18:54:30 -04:00
Jose Diaz-Gonzalez
2d180f5e0f tests: remove extra call to list apps 2021-09-16 00:26:11 -04:00
Jose Diaz-Gonzalez
d83471bd46 fix: do not delete devcontainers when running tests in a docker container 2021-09-16 00:26:11 -04:00
Jose Diaz-Gonzalez
974f601fa9 dev: speed up devcontainer building by only copying the tests.mk file as Makefile first 2021-09-16 00:26:11 -04:00
Jose Diaz-Gonzalez
4a8ed5cd06 feat: add uuid-runtime to fix random id generation in tests 2021-09-16 00:26:11 -04:00
Jose Diaz-Gonzalez
709d8d411c fix: mount correct path for DOKKU_HOST_ROOT 2021-09-16 00:26:11 -04:00
Jose Diaz-Gonzalez
e79b750b6d Merge pull request #4786 from dokku/ps-restore-docs
Add missing argument from trigger documentation
2021-09-14 02:25:33 -04:00
Jose Diaz-Gonzalez
bb4a2da52e docs: add missing argument from trigger documentation 2021-09-14 02:25:08 -04:00
Jose Diaz-Gonzalez
79bb5cb9a7 fix: add make change for devcontainer support 2021-09-14 02:24:16 -04:00
Jose Diaz-Gonzalez
70877e351c Merge pull request #4785 from dokku/devcontainer-support
Add support for VSCode Dev Containers
2021-09-14 02:23:31 -04:00
Jose Diaz-Gonzalez
8877abb83f feat: add support for VSCode Dev Containers
This cannot be used in codespaces due to the extra mount, but it does allow for local development.
2021-09-14 02:22:52 -04:00
Jose Diaz-Gonzalez
cdc5eb9909 feat: upgrade vector image to 0.16.x 2021-09-14 02:19:49 -04:00
Jose Diaz-Gonzalez
e1482df157 Merge pull request #4780 from adam12/adam12-patch-1
Update source for `dokku-update`
2021-09-13 20:54:00 -04:00
Adam Daniels
b45b2db8e7 Update source for dokku-update
The `dokku-update` tool has been extracted into it's own repository, and is
no longer available inside the `dokku` source.
2021-09-13 20:42:41 -04:00
Dokku Bot
d21efd90b4 Release 0.25.4
# History

## 0.25.4

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.4/bootstrap.sh
sudo DOKKU_TAG=v0.25.4 bash bootstrap.sh
```

### Bug Fixes

- #4775: @josegonzalez Add support for url-encoded vector-sink config values …
- #4777: @josegonzalez Set correct version for registry plugin

### Documentation

- #4776: @josegonzalez Clarify valid values for container-type when entering containers

### Other

- #4774: @dependabot[bot] chore(deps): bump sqlparse from 0.4.1 to 0.4.2 in /tests/apps/dockerfile-release
2021-09-11 08:09:10 +00:00
Jose Diaz-Gonzalez
d82a259bab Merge pull request #4775 from dokku/vector-escaped-uri-support
Add support for url-encoded vector-sink config values …
2021-09-11 01:32:15 -04:00
Jose Diaz-Gonzalez
6f64a59f49 Merge pull request #4777 from dokku/josegonzalez-patch-1
Set correct version for registry plugin
2021-09-11 01:32:06 -04:00
Jose Diaz-Gonzalez
d67aa94709 fix: set correct version for registry plugin 2021-09-11 01:31:53 -04:00
Jose Diaz-Gonzalez
f8376c8845 Merge pull request #4776 from dokku/4768-document-enter
Clarify valid values for container-type when entering containers
2021-09-10 23:22:03 -04:00
Jose Diaz-Gonzalez
52f3cf2af0 docs: clarify valid values for container-type when entering containers
Refs #4768
2021-09-10 23:20:16 -04:00
Jose Diaz-Gonzalez
0997fd3347 fix: add support for url-encoded vector-sink config values
We additionally force-replace \u0026 with an ampersand to ensure we properly support & in config values (such as for URIs).
2021-09-10 23:04:41 -04:00
Jose Diaz-Gonzalez
2c4fec77bb refactor: force-set the type and inputs for a vector sink
Previously, a user could inadvertently override the type or the inputs value by specifying those in their config. Instead, we force-set these so that users do not have potentially invalid config.
2021-09-10 23:03:29 -04:00
Jose Diaz-Gonzalez
2a04ed70b6 fix: do not attempt to sprintf properties
Previously, any properties with a % would be formatted using sprintf, causing issues when consuming those values later on.
2021-09-10 23:02:21 -04:00
Jose Diaz-Gonzalez
1ea821a6c3 docs: document the vector-logs command 2021-09-10 23:01:33 -04:00
Jose Diaz-Gonzalez
3358254212 Merge pull request #4774 from dokku/dependabot/pip/tests/apps/dockerfile-release/sqlparse-0.4.2
chore(deps): bump sqlparse from 0.4.1 to 0.4.2 in /tests/apps/dockerfile-release
2021-09-10 19:22:27 -04:00
dependabot[bot]
dbde0b2719 chore(deps): bump sqlparse in /tests/apps/dockerfile-release
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.1 to 0.4.2.
- [Release notes](https://github.com/andialbrecht/sqlparse/releases)
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.1...0.4.2)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 18:45:52 +00:00
Dokku Bot
9ead92a490 Release 0.25.3
# History

## 0.25.3

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.3/bootstrap.sh
sudo DOKKU_TAG=v0.25.3 bash bootstrap.sh
```

### Bug Fixes

- #4767: @josegonzalez Output logs when container rename fails and continue on
- #4764: @josegonzalez Reference correct plugin when setting up app-json plugin

### Refactors

- #4741: @josegonzalez Use a Dockerfile to speed up env var injection for herokuish app builds

### Documentation

- #4763: @josegonzalez Remove install doc references to removed web installer

### Other

- #4766: @josegonzalez Capitalize certain log messages for aesthetic reasons
2021-09-06 18:04:19 +00:00
Jose Diaz-Gonzalez
feb6f2fed6 Merge pull request #4767 from dokku/3900-log-on-rename-fail
Output logs when container rename fails and continue on
2021-09-05 02:31:16 -04:00
Jose Diaz-Gonzalez
128c442b17 Merge pull request #4741 from dokku/faster-builds
Use a Dockerfile to speed up env var injection for herokuish app builds
2021-09-05 02:13:34 -04:00
Jose Diaz-Gonzalez
162db40370 Merge pull request #4766 from dokku/nicer-log-output
Capitalize certain log messages for aesthetic reasons
2021-09-05 02:06:59 -04:00
Jose Diaz-Gonzalez
5855fd069f fix: use RANDOM in upcoming name
This fixes issues where a previous deploy may have failed, consuming that other slot.
2021-09-05 01:15:38 -04:00
Jose Diaz-Gonzalez
c045b1ca6b chore: capitalize certain log messages for aesthetic reasons 2021-09-05 00:36:58 -04:00
Jose Diaz-Gonzalez
d1319977d6 fix: add log message when rename fails and continue
This allows folks to later investigate why the rename failed (probably an app bug) and helpfully posts the container logs.

If multiple containers fail, they may have a ton of output, but this is better than not knowing what is going on.

Closes #3900
2021-09-05 00:35:57 -04:00
Jose Diaz-Gonzalez
9c073364f5 feat: set initial container name for docker-local deploys
This makes it easier to track a Dokku container vs an intermediate container or something created external to Dokku.

The container is properly renamed later on, so the `upcoming` part is just an indicator that the container has potentially not yet passed healthchecks.
2021-09-05 00:35:03 -04:00
Jose Diaz-Gonzalez
e9554447d6 Merge pull request #4764 from dokku/josegonzalez-patch-1
Reference correct plugin when setting up app-json plugin
2021-09-04 23:26:25 -04:00
Jose Diaz-Gonzalez
f3f9d37d59 fix: reference correct plugin when setting up app-json plugin 2021-09-04 22:43:10 -04:00
Jose Diaz-Gonzalez
0454f3bc8f Merge pull request #4763 from dokku/4762-installer-docs
Remove install doc references to removed web installer
2021-09-04 16:31:37 -04:00
Jose Diaz-Gonzalez
aa81bc0589 docs: remove web installer from homepage 2021-09-04 16:31:28 -04:00
Jose Diaz-Gonzalez
3f70ee3e54 Update README.md 2021-09-04 16:27:27 -04:00
Jose Diaz-Gonzalez
c43149f4c9 fix: lint 2021-08-18 03:23:28 -04:00
Jose Diaz-Gonzalez
3d4252f43c refactor: use a Dockerfile to speed up env var injection for herokuish app builds
Herokuish app builds currently spin up a temporary container and then commit that container. The new approach uses a Dockerfile to perform those same actions, avoiding the need for the temporary container.
2021-08-18 03:16:11 -04:00
122 changed files with 1293 additions and 685 deletions

19
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM dokku/dokku:latest
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential file nano && \
apt-get install --no-install-recommends -y help2man shellcheck uuid-runtime wget xmlstarlet && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt/lists/*
ADD https://raw.githubusercontent.com/dokku/dokku/master/tests/dhparam.pem /mnt/dokku/etc/nginx/dhparam.pem
COPY .devcontainer/bin/ /usr/local/bin/
COPY ["tests.mk", "Makefile"]
RUN make ci-dependencies
COPY . .
ENV DOKKU_HOSTNAME=dokku.me
LABEL org.label-schema.schema-version=1.0 org.label-schema.vendor=dokku com.dokku.devcontainer=true

9
.devcontainer/bin/copy-plugin Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
main() {
declare PLUGIN_NAME="$1"
make go-build-plugin copyplugin PLUGIN_NAME=$PLUGIN_NAME
}
main "$@"

View File

@@ -0,0 +1,18 @@
{
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"containerEnv": {
"DOKKU_HOST_ROOT": "${localWorkspaceFolder}/tmp/data/home/dokku",
"GO_ROOT_MOUNT": "${localWorkspaceFolder}:/go/src/github.com/dokku/dokku"
},
"initializeCommand": ["mkdir", "-p", "tmp/data"],
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
"source=${localWorkspaceFolder}/tmp/data/,target=/mnt/dokku/,type=bind"
],
"overrideCommand": false,
"postCreateCommand": ["make", "setup-deploy-tests"],
"runArgs": ["--init"]
}

View File

@@ -1,5 +1,134 @@
# History
## 0.25.6
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.6/bootstrap.sh
sudo DOKKU_TAG=v0.25.6 bash bootstrap.sh
```
### Bug Fixes
- #4841: @josegonzalez Ensure pack is run as root user when building apps in docker
- #4836: @josegonzalez Fix custom dockerfile path detection
- #4839: @josegonzalez Choose the correct app when a named remote is specified in the remote ssh client
### New Features
- #4829: @josegonzalez Add ability to schedule process types in parallel
- #4837: @josegonzalez Filter --link and --volume flags during Dockerfile builds
### Documentation
- #4840: @josegonzalez Explain sha256 image digest alternative when reusing docker image tags for git:from-image deployments
### Tests
- #4842: @josegonzalez Set default process list in test cnb buildpacks
### Other
- #4832: @dependabot[bot] chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/python-flask
- #4833: @dependabot[bot] chore(deps): bump jinja2 from 3.0.1 to 3.0.2 in /tests/apps/python-flask
- #4831: @dependabot[bot] chore(deps): bump flask from 2.0.1 to 2.0.2 in /tests/apps/multi
## 0.25.5
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.5/bootstrap.sh
sudo DOKKU_TAG=v0.25.5 bash bootstrap.sh
```
### Bug Fixes
- #4787: @josegonzalez Do not require double quotes when issuing dokku run commands
- #4816: @josegonzalez Set the DOKKU_HOST_ROOT on docker container start
- #4810: @josegonzalez Handle udp ports when fetching network config
- #4812: @josegonzalez Silence stderr when fetching a command from the Procfile
- #4800: @josegonzalez Add help2man os package for copyfiles make target to devcontainer
- #4796: @josegonzalez Remove the --restart flag from pre-deploy chown containers
### New Features
- #4809: @josegonzalez Implement storage:ensure-directory command
- #4801: @josegonzalez Expose git-from-archive and git-from-image plugin triggers
- #4785: @josegonzalez Add support for VSCode Dev Containers
### Documentation
- #4819: @stephenheron Fixed typo in tar documentation
- #4824: @dy3l Fix GitLab case
- #4822: @josegonzalez Add a note about using the registry:login command for private image deployments
- #4808: @francipvb Added a comment about Dockerfile deployment
- #4807: @FinnWoelm Docs: Fix instructions for enabling Docker Buildkit
- #4786: @josegonzalez Add missing argument from trigger documentation
- #4780: @adam12 Update source for `dokku-update`
### Tests
- #4828: @josegonzalez Update golang in test apps to latest version
- #4815: @josegonzalez tests: use python3 shebang for shellcheck-to-junit script
- #4814: @josegonzalez Add wget to devcontainer to fix shfmt installation
- #4791: @josegonzalez Fix test running in devcontainer
### Other
- #4813: @dependabot[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 197 to 198 in /tests/apps/php
- #4802: @dependabot[bot] chore(deps): bump django from 3.1.12 to 3.1.13 in /tests/apps/dockerfile-release
- #4784: @josegonzalez Upgrade vector image to 0.16.x
## 0.25.4
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.4/bootstrap.sh
sudo DOKKU_TAG=v0.25.4 bash bootstrap.sh
```
### Bug Fixes
- #4775: @josegonzalez Add support for url-encoded vector-sink config values …
- #4777: @josegonzalez Set correct version for registry plugin
### Documentation
- #4776: @josegonzalez Clarify valid values for container-type when entering containers
### Other
- #4774: @dependabot[bot] chore(deps): bump sqlparse from 0.4.1 to 0.4.2 in /tests/apps/dockerfile-release
## 0.25.3
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.3/bootstrap.sh
sudo DOKKU_TAG=v0.25.3 bash bootstrap.sh
```
### Bug Fixes
- #4767: @josegonzalez Output logs when container rename fails and continue on
- #4764: @josegonzalez Reference correct plugin when setting up app-json plugin
### Refactors
- #4741: @josegonzalez Use a Dockerfile to speed up env var injection for herokuish app builds
### Documentation
- #4763: @josegonzalez Remove install doc references to removed web installer
### Other
- #4766: @josegonzalez Capitalize certain log messages for aesthetic reasons
## 0.25.2
Install/update via the bootstrap script:

View File

@@ -98,11 +98,11 @@ Otherwise, you will need to import the keypair manually after installation using
To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.2/bootstrap.sh
sudo DOKKU_TAG=v0.25.2 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.6/bootstrap.sh
sudo DOKKU_TAG=v0.25.6 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
You can then proceed to configure your server domain (via `dokku domains:set-global`) and user access (via `dokku ssh-keys:add`) to complete the installation.
If you wish for a more unattended installation method, see [these](https://dokku.com/docs/getting-started/install/debian/#unattended-installation) docs.

View File

@@ -4,6 +4,7 @@ GO_REPO_ROOT := /go/src/github.com/dokku/dokku
BUILD_IMAGE := golang:1.15.6
GO_BUILD_CACHE ?= /tmp/dokku-go-build-cache
GO_MOD_CACHE ?= /tmp/dokku-go-mod-mod
GO_ROOT_MOUNT ?= $$PWD/../..:$(GO_REPO_ROOT)
.PHONY: build-in-docker build clean src-clean
@@ -12,7 +13,7 @@ build: $(BUILD)
build-in-docker: clean
mkdir -p /tmp/dokku-go-build-cache
docker run --rm \
-v $$PWD/../..:$(GO_REPO_ROOT) \
-v $(GO_ROOT_MOUNT) \
-v $(GO_BUILD_CACHE):/root/.cache \
-v $(GO_MOD_CACHE):/go/pkg/mod \
-e PLUGIN_NAME=$(PLUGIN_NAME) \

View File

@@ -104,7 +104,7 @@ main() {
if [[ -z "$APP" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
set +e
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
APP=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
else
echo " ! This is not a git repository" 1>&2

6
debian/control vendored
View File

@@ -1,10 +1,10 @@
Package: dokku
Version: 0.25.2
Version: 0.25.6
Section: web
Priority: optional
Architecture: amd64
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.2), net-tools, netrc, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip
Recommends: herokuish (>= 0.3.4), bash-completion, parallel, dokku-update, dokku-event-listener
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.2), net-tools, netrc, software-properties-common, parallel, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip
Recommends: herokuish (>= 0.3.4), bash-completionl, dokku-update, dokku-event-listener
Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Description: Docker-powered PaaS that helps build and manage the lifecycle of applications

View File

@@ -62,6 +62,12 @@ main() {
echo "export DOCKER_BIN=/usr/local/bin/docker" >"/home/dokku/.dokkurc/DOCKER_BIN"
fi
if [[ -n "$DOKKU_HOST_ROOT" ]]; then
touch /etc/default/dokku
echo "export DOKKU_HOST_ROOT=$DOKKU_HOST_ROOT" >>/etc/default/dokku
chown dokku:dokku /etc/default/dokku
fi
NGINX_ROOT="/etc/nginx"
if [[ -x /usr/bin/openresty ]]; then
NGINX_ROOT="/usr/local/openresty/nginx/conf"

View File

@@ -1 +1 @@
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler,/usr/bin/pack

20
docker/usr/local/bin/pack Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $TRACE ]] && set -x
main() {
declare desc="re-runs pack commands as sudo"
local PACK_BIN=""
if [[ -x "/usr/bin/pack" ]]; then
PACK_BIN="/usr/bin/pack"
fi
if [[ -z "$PACK_BIN" ]]; then
echo "! No pack binary found" 1>&2
exit 1
fi
sudo -E "$PACK_BIN" "$@"
}
main "$@"

View File

@@ -5,10 +5,11 @@
The preferred method to mount external containers to a Dokku managed container, is to use the Dokku storage plugin.
```
storage:list <app> # List bind mounts for app's container(s) (host:container)
storage:mount <app> <host-dir:container-dir> # Create a new bind mount
storage:report [<app>] [<flag>] # Displays a checks report for one or more apps
storage:unmount <app> <host-dir:container-dir> # Remove an existing bind mount
storage:ensure-directory [--chown option] <directory> # Creates a persistent storage directory in the recommended storage path
storage:list <app> # List bind mounts for app's container(s) (host:container)
storage:mount <app> <host-dir:container-dir> # Create a new bind mount
storage:report [<app>] [<flag>] # Displays a checks report for one or more apps
storage:unmount <app> <host-dir:container-dir> # Remove an existing bind mount
```
> The storage plugin is compatible with storage mounts created with the docker-options. The storage plugin will only list mounts from the deploy/run phase.
@@ -20,50 +21,77 @@ The storage plugin supports the following mount points:
## Usage
This example demonstrates how to mount the recommended directory to `/storage` inside an application called `node-js-app`. For simplicity, the Dokku project recommends using the directory `/var/lib/dokku/data/storage` directory as the root host path for mounts. This directory is created on Dokku installation.
### Creating storage directories
> New as of 0.25.5
A storage directory can be created with the `storage:ensure-directory` command. This command will create a subdirectory in the recommended `/var/lib/doku/data/storage` path - created during Dokku installation - and prepare it for use with an app.
```shell
# we use a subdirectory inside of the host directory to scope it to just the app
dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/storage
dokku storage:ensure-directory lollipop
```
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage/node-js-app` to `/storage` inside the container. Mounts are only available for containers crated via `run` and by the deploy process, and not during the build process. In addition, the host path is never auto-created by either Dokku or Docker, and should be an explicit path, not one relative to the current working directory.
```
-----> Ensuring /var/lib/dokku/data/storage/lollipop exists
Setting directory ownership to 32767:32767
Directory ready for mounting
```
> If the `/storage` path within the container had pre-existing content, the container files will be overrwritten. This may be an issue for users that create assets at build time but then mount a directory at the same place during runtime. Files are not merged.
By default, permissions are set for usage with Herokuish buildpacks. These permissions can be changed via the `--chown` option according to the following table:
Once you have mounted persistent storage, you will also need to restart the application. See the
[process scaling documentation](/docs/processes/process-management.md) for more information.
- `--chown herokuish` (default): Use `32767:32767` as the folder permissions.
- This is used for apps deployed with Buildpacks via Herokuish.
- `--chown heroku`: Use `1000:1000` as the folder permissions.
- This is used for apps deployed with Cloud Native Buildpacks using the `heroku/buildpacks` builder.
- `--chown packeto`: Use `2000:2000` as the folder permissions.
- This is used for apps deployed with Cloud Native Buildpacks using the `cloudfoundry/cnb` or `packeto` builders.
- `--chown false`: Skips the `chown` call.
Users deploying via Dockerfile will want to specify `--chown false` and manually `chown` the created directory if the user and/or group id of the runnning process in the deployed container do not correspond to any of the above options.
> Warning: Failing to set the correct directory ownership may result in issues in persisting files written to the mounted storage directory.
### Mounting storage into apps
Dokku supports mounting both explicit host paths as well as docker volumes via the `storage:mount` command. This takes two arguments, an app name and a `host-path:container-path` or `docker-volume:container-path` combination.
```shell
# mount the directory into your container's /app/storage directory, relative to the container root (/)
# explicit host paths _must_ exist prior to usage.
dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/app/storage
# mount the docker volume into your container's /app/storage directory, relative to the container root (/)
# docker volumes _must_ exist prior to usage.
dokku storage:mount node-js-app some-docker-volume:/app/storage
```
In the first example, Dokku will then mount the shared contents of `/var/lib/dokku/data/storage/node-js-app` to `/app/storage` inside the container. The mount point is *not* relative to your app's working directory, and is instead relative to the root (`/`) of the container. Mounts are only available for containers created via `run` and by the deploy process, and not during the build process. In addition, the host path is never auto-created by either Dokku or Docker, and should be an explicit path, not one relative to the current working directory.
> If the `/storage` path within the container had pre-existing content, the container files will be over-written. This may be an issue for users that create assets at build time but then mount a directory at the same place during runtime. Files are not merged.
Once persistent storage is mounted, the app requires a restart. See the [process scaling documentation](/docs/processes/process-management.md) for more information.
```shell
dokku ps:restart app-name
```
A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root (`/`) of the container.
### Unmounting storage
If an app no longer requires a mounted volume or directory, the `storage:unmount` command can be called. This takes the same arguments as the `storage:mount` command, an app name and a `host-path:container-path` or `docker-volume:container-path` combination.
```shell
# creating storage for the app 'node-js-app'
mkdir -p /var/lib/dokku/data/storage/node-js-app
# unmount the directory from your container's /app/storage directory, relative to the container root (/)
dokku storage:unmount node-js-app /var/lib/dokku/data/storage/node-js-app:/app/storage
# set the directory ownership. Below is an example for herokuish
# but see the `Directory Permissions` section for more details
chown -R 32767:32767 /var/lib/dokku/data/storage/node-js-app
# mount the directory into your container's /app/storage directory, relative to root
dokku storage:mount app-name /var/lib/dokku/data/storage/node-js-app:/app/storage
# unmount the docker volume from your container's /app/storage directory, relative to the container root (/)
dokku storage:unmount node-js-app some-docker-volume:/app/storage
```
You can mount one or more directories as desired by following the above pattern.
Once persistent storage is unmounted, the app requires a restart. See the [process scaling documentation](/docs/processes/process-management.md) for more information.
### Directory Permissions
The host directory should always be owned by the container user and group id. If this is not the case, files may not persist when written to mounted storage.
- Buildpacks via Herokuish: Use `32767:32767` as the file permissions
- For Cloud Native Buildpacks: This will depend on the builder in question, but can be retrieved via the `CNB_USER_ID` and `CNB_GROUP_ID` environment variables on the builder image. Common builders are as follows:
- heroku/buildpacks: `1000:1000`
- cloudfoundry/cnb: `2000:2000`
- packeto: `2000:2000`
- Dockerfile and Docker Image: Use the user and group id which corresponds to the one running the process within the container.
```shell
dokku ps:restart app-name
```
### Displaying storage reports for an app
@@ -113,7 +141,7 @@ dokku storage:report node-js-app --storage-deploy-mounts
### Sharing storage across deploys
Dokku is powered by Docker containers, which recommends in their [best practices](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#containers-should-be-ephemeral) that containers be treated as ephemeral. In order to manage persistent storage for web applications, like user uploads or large binary assets like images, a directory outside the container should be mounted.
Dokku is powered by Docker containers, which recommends in their [best practices](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#containers-should-be-ephemeral) that containers be treated as ephemeral. In order to manage persistent storage for web apps, like user uploads or large binary assets like images, a directory outside the container should be mounted.
### Shared storage between containers
@@ -139,11 +167,11 @@ You cannot use mounted volumes during the build phase of a Dockerfile deploy. Th
> Note: **This can cause data loss** if you bind a mount under `/app` in buildpack apps as herokuish will attempt to remove the original app path during the build phase.
## Application User and Persistent Storage file ownership (buildpack apps only)
## App User and Persistent Storage file ownership (buildpack apps only)
> New as of 0.7.1
By default, Dokku will execute your buildpack application processes as the `herokuishuser` user. You may override this by setting the `DOKKU_APP_USER` config variable.
By default, Dokku will execute your buildpack app processes as the `herokuishuser` user. You may override this by setting the `DOKKU_APP_USER` config variable.
> NOTE: this user must exist in your herokuish image.

View File

@@ -35,35 +35,35 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.25.2 enabled dokku core standard plugin
20_events 0.25.2 enabled dokku core events logging plugin
app-json 0.25.2 enabled dokku core app-json plugin
apps 0.25.2 enabled dokku core apps plugin
build-env 0.25.2 enabled dokku core build-env plugin
buildpacks 0.25.2 enabled dokku core buildpacks plugin
certs 0.25.2 enabled dokku core certificate management plugin
checks 0.25.2 enabled dokku core checks plugin
common 0.25.2 enabled dokku core common plugin
config 0.25.2 enabled dokku core config plugin
docker-options 0.25.2 enabled dokku core docker-options plugin
domains 0.25.2 enabled dokku core domains plugin
enter 0.25.2 enabled dokku core enter plugin
git 0.25.2 enabled dokku core git plugin
logs 0.25.2 enabled dokku core logs plugin
network 0.25.2 enabled dokku core network plugin
nginx-vhosts 0.25.2 enabled dokku core nginx-vhosts plugin
plugin 0.25.2 enabled dokku core plugin plugin
proxy 0.25.2 enabled dokku core proxy plugin
ps 0.25.2 enabled dokku core ps plugin
repo 0.25.2 enabled dokku core repo plugin
resource 0.25.2 enabled dokku core resource plugin
scheduler-docker-local 0.25.2 enabled dokku core scheduler-docker-local plugin
shell 0.25.2 enabled dokku core shell plugin
ssh-keys 0.25.2 enabled dokku core ssh-keys plugin
storage 0.25.2 enabled dokku core storage plugin
tags 0.25.2 enabled dokku core tags plugin
tar 0.25.2 enabled dokku core tar plugin
trace 0.25.2 enabled dokku core trace plugin
00_dokku-standard 0.25.6 enabled dokku core standard plugin
20_events 0.25.6 enabled dokku core events logging plugin
app-json 0.25.6 enabled dokku core app-json plugin
apps 0.25.6 enabled dokku core apps plugin
build-env 0.25.6 enabled dokku core build-env plugin
buildpacks 0.25.6 enabled dokku core buildpacks plugin
certs 0.25.6 enabled dokku core certificate management plugin
checks 0.25.6 enabled dokku core checks plugin
common 0.25.6 enabled dokku core common plugin
config 0.25.6 enabled dokku core config plugin
docker-options 0.25.6 enabled dokku core docker-options plugin
domains 0.25.6 enabled dokku core domains plugin
enter 0.25.6 enabled dokku core enter plugin
git 0.25.6 enabled dokku core git plugin
logs 0.25.6 enabled dokku core logs plugin
network 0.25.6 enabled dokku core network plugin
nginx-vhosts 0.25.6 enabled dokku core nginx-vhosts plugin
plugin 0.25.6 enabled dokku core plugin plugin
proxy 0.25.6 enabled dokku core proxy plugin
ps 0.25.6 enabled dokku core ps plugin
repo 0.25.6 enabled dokku core repo plugin
resource 0.25.6 enabled dokku core resource plugin
scheduler-docker-local 0.25.6 enabled dokku core scheduler-docker-local plugin
shell 0.25.6 enabled dokku core shell plugin
ssh-keys 0.25.6 enabled dokku core ssh-keys plugin
storage 0.25.6 enabled dokku core storage plugin
tags 0.25.6 enabled dokku core tags plugin
tar 0.25.6 enabled dokku core tar plugin
trace 0.25.6 enabled dokku core trace plugin
```
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.

View File

@@ -2,10 +2,10 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-310x150.png"/>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

@@ -2,37 +2,37 @@
"name": "Dokku",
"icons": [
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.25.6\/docs\/assets\/favicons\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"

View File

@@ -42,13 +42,13 @@ h1 {
font-size: 1.6em;
}
.header .navbar-brand a {
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/dokku.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/dokku.png);
text-indent: 40px;
}
.blurb {
color: #424242;
background-color: #ededed;
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/gplaypattern.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}

View File

@@ -22,6 +22,6 @@
"0.22.9",
"0.23.9",
"0.24.10",
"0.25.2"
"0.25.6"
]
}

View File

@@ -148,12 +148,8 @@ RUN echo $NODE_ENV
If your Dockerfile is using Docker engine's [buildkit](https://docs.docker.com/develop/develop-images/build_enhancements/) (not to be confused with buildpacks), then the `DOCKER_BUILDKIT=1` environment variable needs to be set. Additionally, complete build log output can be forced via `BUILDKIT_PROGRESS=plain`. Both of these environment variables can be set as follows:
```shell
# via config:set
dokku config:set --global DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain
# on the /etc/default/dokku file
echo DOCKER_BUILDKIT=1 | sudo tee -a /etc/default/dokku
echo BUILDKIT_PROGRESS=plain | sudo tee -a /etc/default/dokku
echo "export DOCKER_BUILDKIT=1" | sudo tee -a /etc/default/dokku
echo "export BUILDKIT_PROGRESS=plain" | sudo tee -a /etc/default/dokku
```
#### Buildkit directory caching

View File

@@ -37,7 +37,7 @@ You can use these modifiers as follows:
dokku logs node-js-app -t -p web
```
will show logs continually from the web process.
The above command will show logs continually from the web process.
### Failed deploy logs
@@ -127,6 +127,29 @@ dokku logs:vector-stop
The `vector` container will be stopped and removed from the system. If the container is not running, this command will do nothing.
#### Checking Vector's Logs
It may be necessary to check the vector container's logs to ensure that vector is operating as expected. This can be performed with the `logs:vector-logs` command.
```shell
dokku logs:vector-logs
```
This command also supports the following modifiers:
```shell
--num NUM # the number of lines to display
--tail # continually stream logs
```
You can use these modifiers as follows:
```shell
dokku logs:vector-logs --tail --num 10
```
The above command will show logs continually from the vector container, with an initial history of 10 log lines
#### Configuring a log sink
Vector uses the concept of log "sinks" to send logs to a given endpoint. Log sinks may be configured globally or on a per-app basis by specifying a `vector-sink` in DSN form with the `logs:set` command. Specifying a sink value will reload any running vector container.
@@ -174,4 +197,13 @@ Valid values for `SINK_TYPE` include all log vector log sinks, while `SINK_OPTIO
- `[int]`: form: `key[]=int`
- `table`: form: `option[key]=value`
For some sinks - such as the `http` sink - it may be useful to use special characters such as `&`. These characters must be url escaped as per [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986.html).
```shell
# the following command will set the `http` sink with a uri config value
# for a uri config value: https://loggerservice.com:1234/?token=abc1234&type=vector
# the url quoted version: https%3A//loggerservice.com%3A1234/%3Ftoken%3Dabc1234%26type%3Dvector
dokku logs:set test vector-sink "http://?uri=https%3A//loggerservice.com%3A1234/%3Ftoken%3Dabc1234%26type%3Dvector"
```
Please read the [sink documentation](https://vector.dev/docs/reference/sinks/) for your sink of choice to configure the sink as desired.

View File

@@ -135,7 +135,18 @@ In the above example, Dokku will build the app as if the repository contained _o
FROM dokku/node-js-getting-started:latest
```
Triggering a build with the same arguments multiple times will result in Dokku exiting `0` early as there will be no changes detected.
Triggering a build with the same arguments multiple times will result in Dokku exiting `0` early as there will be no changes detected. If the image tag is reused but the underlying image is different, it is recommended to use the image digest instead of the tag. This can be retrieved via the following command:
```shell
docker inspect --format='{{index .RepoDigests 0}}' $IMAGE_NAME
```
The resulting `git:from-image` call would then be:
```shell
# where the image sha is: sha256:9d187c3025d03c033dcc71e3a284fee53be88cc4c0356a19242758bc80cab673
dokku git:from-image node-js-app dokku/node-js-getting-started:@sha256:9d187c3025d03c033dcc71e3a284fee53be88cc4c0356a19242758bc80cab673
```
The `git:from-image` command can optionally take a git `user.name` and `user.email` argument (in that order) to customize the author. If the arguments are left empty, they will fallback to `Dokku` and `automated@dokku.sh`, respectively.
@@ -143,6 +154,8 @@ The `git:from-image` command can optionally take a git `user.name` and `user.ema
dokku git:from-image node-js-app dokku/node-js-getting-started:latest "Camila" "camila@example.com"
```
If the image is a private image that requires a docker login to access, the `registry:login` command should be used to log into the registry. See the [registry documentation](/docs/advanced-usage/registry-management.md#logging-into-a-registry) for more details on this process.
Finally, certain images may require a custom build context in order for `ONBUILD ADD` and `ONBUILD COPY` statements to succeed. A custom build context can be specified via the `--build-dir` flag. All files in the specified `build-dir` will be copied into the repository for use within the `docker build` process. The build context _must_ be specified on each deploy, and is not otherwise persisted between builds.
```shell

View File

@@ -1,6 +1,6 @@
# Tarball Deployment
> Warning: As of 0.24.0, this functionality is deprecated in favor of the [`git:from-archive`](/docs/deployment/methods/git.md#initializing-an-app-repository-from-an-archive-file) command. It will be removed in a future release, and is considered unmaintained. Users are highly encouraged to switch their workflows to `git:from-arhive`.
> Warning: As of 0.24.0, this functionality is deprecated in favor of the [`git:from-archive`](/docs/deployment/methods/git.md#initializing-an-app-repository-from-an-archive-file) command. It will be removed in a future release, and is considered unmaintained. Users are highly encouraged to switch their workflows to `git:from-archive`.
>
> New as of 0.4.0

View File

@@ -37,6 +37,29 @@ Once set, you may re-enable it by setting a blank value for `disable-chown`:
dokku scheduler-docker-local:set node-js-app disable-chown
```
### Deploying Process Types in parallel
> New as of 25.5
By default, Dokku deploys an app's processes one-by-one in order, with the `web` process being deployed first. Deployment parallelism may be achieved by setting the `parallel-schedule-count` property, which defaults to `1`. Increasing this number increases the number of process types that may be deployed in parallel (with the web process being the exception).
```shell
# Increase parallelism from 1 process type at a time to 4 process types at a time.
dokku scheduler-docker-local:set node-js-app parallel-schedule-count 4
```
Once set, you may reset it by setting a blank value for `parallel-schedule-count`:
```shell
dokku scheduler-docker-local:set node-js-app parallel-schedule-count
```
If the value of `parallel-schedule-count` is increased and a given process type fails to schedule successfully, then any in-flight process types will continue to be processed, while all process types that have not been scheduled will be skipped before the deployment finally fails.
Container scheduling output is shown in the order it is received, and thus may be out of order in case of output to stderr.
Note that increasing the value of `parallel-schedule-count` may significantly impact CPU utilization on your host as your app containers - and their respective processes - start up. Setting a value higher than the number of available CPUs is discouraged. It is recommended that users carefully set this value so as not to overburden their server.
## Implemented Triggers
This plugin implements various functionality through `plugn` triggers to integrate with Docker for running apps on a single server. The following functionality is supported by the `scheduler-docker-local` plugin.

View File

@@ -723,6 +723,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `git-from-archive`
- Description: Updates an app's git repository from an archive and then triggers a build
- Invoked by: `git:from-archive`
- Arguments: `$APP $ARCHIVE_URL $ARCHIVE_TYPE $USER_NAME $USER_EMAIL`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `git-from-directory`
- Description: Updates an app's git repository from a source directory and then triggers a build
@@ -738,6 +753,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `git-from-image`
- Description: Updates an app's git repository from a docker image and then triggers a build as necessary
- Invoked by: `git:from-image`
- Arguments: `$APP $DOCKER_IMAGE $BUILD_DIR $USER_NAME $USER_EMAIL`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `git-post-pull`
- Description:
@@ -1674,7 +1704,7 @@ APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
- Description: Allows you to run commands before all containers are restored
- Invoked by: `dokku ps:restore`
- Arguments: `$DOKKU_SCHEDULER`
- Arguments: `$DOKKU_SCHEDULER $APP`
- Example:
```shell

View File

@@ -29,7 +29,7 @@ The workflow looks like this:
```shell
# having dokku-arch in ../dokku-arch
vagrant up build-arch
# wait for "==> build-arch: ==> Finished making: dokku 0.25.2-2 (Mon Feb 22 23:20:37 CET 2016)"
# wait for "==> build-arch: ==> Finished making: dokku 0.25.6-2 (Mon Feb 22 23:20:37 CET 2016)"
cd ../dokku-arch
git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9'

View File

@@ -3,7 +3,7 @@
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.25.2
docker pull dokku/dokku:0.25.6
```
Next, run the image.
@@ -11,13 +11,14 @@ Next, run the image.
```shell
docker container run \
--env DOKKU_HOSTNAME=dokku.me \
--env DOKKU_HOST_ROOT=/var/lib/dokku/home/dokku \
--name dokku \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.25.2
dokku/dokku:0.25.6
```
Dokku is run in the following configuration:
@@ -28,7 +29,8 @@ Dokku is run in the following configuration:
- Container HTTP port 80 is exposed on the host as 8080.
- Container HTTPS port 443 is exposed on the host as 8443.
- Data within the container is stored on the host within the `/var/lib/dokku` directory.
- The docker socket is mounted into container
- Image build cache is set to the data dir + `/home/dokku`.
- The docker socket is mounted into container.
Application repositories, plugin config, as well as plugin data are persisted to disk within the specified host directory for `/var/lib/dokku`.

View File

@@ -19,8 +19,8 @@ To install the latest stable version of Dokku, you can run the following shell c
```shell
# for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.2/bootstrap.sh;
sudo DOKKU_TAG=v0.25.2 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.25.6/bootstrap.sh;
sudo DOKKU_TAG=v0.25.6 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -64,6 +64,25 @@ Save the file and try stopping nginx and starting it again:
## * Starting nginx nginx [ OK ]
```
---
Using the `EXPOSE` directive in a Dockerfile may be another reason why you might see the default site. When the `EXPOSE` directive is in use and a proxy plugin is enabled (the default), the proxy plugin will listen to requests on the ports specified in the `EXPOSE` stanza.
For example, if you have an `EXPOSE` directive like so:
```Dockerfile
EXPOSE 8000
```
The proxy port mapping will be `http:8000:8000`.
To avoid this issue, either of the following can be done:
- Remove `EXPOSE` directive: This will require respecting the `$PORT` environment variable (automatically set by Dokku). Once that change is deployed, the port mapping should be cleared via the `dokku proxy:ports-clear $APP` command (where `$APP` is your app name).
- Update the port mapping: Updating the port mapping to redirect port `80` to your app's exposed port via `dokku proxy:ports-set $APP http:80:$EXPOSED_PORT` can also fix the issue. This will also allow certificate management and the letsencrypt plugin to work correctly.
See the [port management documentation](/docs/networking/port-management.md) for more information on how Dokku exposes ports for applications and how you can configure these for your app.
### I want to deploy my app, but while pushing I get the following error
The following error may be emitted from a deploy:

View File

@@ -87,7 +87,8 @@ We provide a helpful binary called `dokku-update`. This is a recommended package
- Automates many of the upgrade instructions for you.
- Provides a clean way for us to further enhance the upgrade process in the future.
When installing from source, this is available from `contrib/dokku-update`, and is also available on Debian and RPM-based systems from our package repositories under the name `dokku-update`.
This binary is available on Debian and RPM-based systems from our package repositories under the name `dokku-update`. When installing from source,
this is available from a separate Github repository at [dokku/dokku-update](https://github.com/dokku/dokku-update).
## Upgrading using `apt`

View File

@@ -10,30 +10,30 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style>
</style>
@@ -95,15 +95,18 @@
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.25.2/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.25.6/bootstrap.sh</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.25.2 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.25.6 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
<span class="output">&nbsp;# Configure your server domain via `dokku domains:set-global`</span>
</p>
<p class="line">
<span class="output">&nbsp;# and user access (via `dokku ssh-keys:add`) to complete the installation</span>
</p>
</div>
@@ -163,7 +166,10 @@
<span class="command">dokku plugin:install-dependencies --core <span class="output"># run with root!</span></span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
<span class="output">&nbsp;# Configure your server domain via `dokku domains:set-global`</span>
</p>
<p class="line">
<span class="output">&nbsp;# and user access (via `dokku ssh-keys:add`) to complete the installation</span>
</p>
</div>

View File

@@ -11,14 +11,26 @@ enter <app> [<container-type> || --container-id <container-id>] # Connect to a
The `enter` command can be used to enter a running container. The following variations of the command exist:
```shell
# enter the web process
dokku enter node-js-app web
# enter the first web process
dokku enter node-js-app web.1
# enter a process for an app by container ID
dokku enter node-js-app --container-id ID
```
The `container-type` argument can be one either:
- If your app has a `Procfile`, the name of a process type in your `Procfile`.
- If your app has no `Procfile`, the word `web`.
If the specified process type is scaled up to more than one container, then the first container will be automatically selected. this can be overriden by specifying an integer index denoting the desired container, where the first container's index is `1`.
Additionally, the `enter` command can be executed with no `<container-type>`. If only a single `<container-type>` is defined in the app's Procfile, executing `enter` will drop the terminal into the only running container. This behavior is not supported when specifying a custom command; as described below.
By default, it runs a `/bin/bash`, but can also be used to run a custom command:
By default, `dokku enter` will run a `/bin/bash`, but can also be used to run custom commands:
```shell
# just echo hi

View File

@@ -9,26 +9,26 @@
<meta name="author" content="">
<title>Dokku - {{DOC_TITLE}}</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script>
@@ -42,7 +42,7 @@
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.2/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.25.6/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<style>
@@ -171,7 +171,7 @@
<a href="#" class="list-group-item disabled">Continuous Integration</a>
<a href="/{{NAME}}/deployment/continuous-integration/github-actions/" class="list-group-item">GitHub Actions</a>
<a href="/{{NAME}}/deployment/continuous-integration/gitlab-ci/" class="list-group-item">Gitlab CI</a>
<a href="/{{NAME}}/deployment/continuous-integration/gitlab-ci/" class="list-group-item">GitLab CI</a>
<a href="/{{NAME}}/deployment/continuous-integration/generic/" class="list-group-item">Generic</a>
<a href="#" class="list-group-item disabled">Community Contributions</a>

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core app-json plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -10,8 +10,8 @@ import (
// TriggerInstall initializes app restart policies
func TriggerInstall() error {
if err := common.PropertySetup("common"); err != nil {
return fmt.Errorf("Unable to install the common plugin: %s", err.Error())
if err := common.PropertySetup("app-json"); err != nil {
return fmt.Errorf("Unable to install the app-json plugin: %s", err.Error())
}
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json")

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -21,17 +21,6 @@ trigger-builder-dockerfile-builder-build() {
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
local NEW_DOCKERFILE="$(fn-builder-dockerfile-computed-dockerfile-path "$APP")"
if [[ -n "$NEW_DOCKERFILE" ]]; then
if [[ ! -f "$NEW_DOCKERFILE" ]]; then
dokku_log_fail "Invalid dockerfile-path specified: $NEW_DOCKERFILE"
fi
if [[ "$NEW_DOCKERFILE" != "Dockerfile" ]]; then
mv "$NEW_DOCKERFILE" Dockerfile
fi
fi
# extract first port from Dockerfile
suppress_output dos2unix Dockerfile
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
@@ -42,8 +31,8 @@ trigger-builder-dockerfile-builder-build() {
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
# strip --volume and -v args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/^--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
# strip --link, --volume and -v args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/^--link=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--link[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/^--volume[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" -e "s/^-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/builder-dockerfile/internal-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-builder-dockerfile-core-post-extract() {
declare desc="builder-dockerfile post-extract plugin trigger"
declare trigger="post-extract"
declare APP="$1" SOURCECODE_WORK_DIR="$2"
local NEW_DOCKERFILE="$(fn-builder-dockerfile-computed-dockerfile-path "$APP")"
pushd "$TMP_WORK_DIR" >/dev/null
if [[ -z "$NEW_DOCKERFILE" ]]; then
return
fi
if [[ "$NEW_DOCKERFILE" == "Dockerfile" ]]; then
return
fi
if [[ ! -f "$NEW_DOCKERFILE" ]]; then
dokku_log_fail "Invalid dockerfile-path specified: $NEW_DOCKERFILE"
return
fi
mv "$NEW_DOCKERFILE" Dockerfile
popd &>/dev/null
}
trigger-builder-dockerfile-core-post-extract "$@"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-dockerfile plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -15,32 +15,21 @@ trigger-builder-herokuish-builder-release() {
local CID
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
local DOCKER_BUILD_LABEL_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP --label=com.dokku.image-stage=release --label=dokku"
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then
CID=$(config_export global | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
dokku_log_warn "Failure injecting global environment variables"
return 1
fi
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
plugn trigger scheduler-register-retired "$APP" "$CID"
fi
if [[ -n $(config_export app "$APP") ]]; then
CID=$(config_export app "$APP" | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
dokku_log_warn "Failure injecting app environment variables"
return 1
fi
TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")"
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
plugn trigger scheduler-register-retired "$APP" "$CID"
config_export global >"$TMP_WORK_DIR/00-global-env.sh"
config_export app "$APP" >"$TMP_WORK_DIR/01-app-env.sh"
if ! suppress_output "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS -f "$PLUGIN_AVAILABLE_PATH/builder-herokuish/dockerfiles/builder-release.Dockerfile" --build-arg APP_IMAGE="$IMAGE" -t $IMAGE "$TMP_WORK_DIR"; then
dokku_log_warn "Failure injecting environment variables"
return 1
fi
docker-image-labeler --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku "$IMAGE"
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
plugn trigger post-release-builder "$BUILDER_TYPE" "$APP" "$IMAGE"
}

View File

@@ -0,0 +1,4 @@
ARG APP_IMAGE
FROM $APP_IMAGE
COPY 00-global-env.sh 01-app-env.sh /app/.profile.d/

View File

@@ -0,0 +1,5 @@
ARG APP_IMAGE
FROM $APP_IMAGE
COPY .env.d /tmp/env
COPY .env /app/.env

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-herokuish plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -8,10 +8,9 @@ trigger-builder-herokuish-pre-build-buildpack() {
declare desc="builder-herokuish pre-build-buildpack plugin trigger"
declare trigger="pre-build-buildpack"
declare APP="$1"
local IMAGE CID
local IMAGE TMP_WORK_DIR
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
local DOCKER_BUILD_LABEL_ARGS="--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP"
IMAGE=$(get_app_image_name "$APP")
@@ -19,26 +18,23 @@ trigger-builder-herokuish-pre-build-buildpack() {
[[ -z $(config_get --global CURL_TIMEOUT) ]] && config_set --global CURL_TIMEOUT=600
dokku_log_info1 "Adding BUILD_ENV to build environment..."
TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")"
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
mkdir -p "$TMP_WORK_DIR/.env.d"
# create build env files for use in buildpacks like this:
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
CID=$(config_bundle --merged "$APP" | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "mkdir -p /tmp/env; cat | tar -x -C /tmp/env")
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
config_bundle --merged "$APP" | tar -x -C "$TMP_WORK_DIR/.env.d"
# create build env for 'old style' buildpacks and dokku plugins
config_export app "$APP" --format envfile --merged >"$TMP_WORK_DIR/.env"
if ! suppress_output "$DOCKER_BIN" image build "${DOCKER_BUILD_LABEL_ARGS[@]}" $DOKKU_GLOBAL_BUILD_ARGS -f "$PLUGIN_AVAILABLE_PATH/builder-herokuish/dockerfiles/pre-build.Dockerfile" --build-arg APP_IMAGE="$IMAGE" -t $IMAGE "$TMP_WORK_DIR"; then
dokku_log_warn "Failure injecting BUILD_ENV into build environment"
return 1
fi
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
plugn trigger scheduler-register-retired "$APP" "$CID"
# create build env for 'old style' buildpacks and dokku plugins
CID=$(config_export app "$APP" --format envfile --merged | "$DOCKER_BIN" container run "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -i -a stdin "$IMAGE" /bin/bash -c "cat >> /app/.env")
if test "$("$DOCKER_BIN" container wait "$CID")" -ne 0; then
dokku_log_warn "Failure injecting old-style BUILD_ENV"
return 1
fi
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$CID" "$IMAGE" >/dev/null
plugn trigger scheduler-register-retired "$APP" "$CID"
dokku_log_verbose_quiet "BUILD_ENV added successfully"
}
trigger-builder-herokuish-pre-build-buildpack "$@"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-null plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-pack plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core buildpacks plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -21,7 +21,7 @@ migrate_checks_vars_0_5_0() {
dokku_log_info2 "DOKKU_SKIP_ALL_CHECKS DOKKU_SKIP_DEFAULT_CHECKS"
dokku_log_info2 "Please use dokku checks:[disable|enable] <app> to control zero downtime functionality"
dokku_log_info2 ""
dokku_log_info2 "zero downtime checks disabled for app ($app)"
dokku_log_info2 "Zero downtime checks disabled for app ($app)"
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_CHECKS_ENABLED=0
fi
if [[ -n "$APP_SKIP_ALL_CHECKS" ]] || [[ -n "$APP_SKIP_DEFAULT_CHECKS" ]]; then
@@ -48,7 +48,7 @@ migrate_checks_vars_0_6_0() {
dokku_log_info2 "DOKKU_CHECKS_ENABLED -> DOKKU_CHECKS_SKIPPED"
if [[ "$APP_DOKKU_CHECKS_ENABLED" == "0" ]]; then
dokku_log_info2 ""
dokku_log_info2 "zero downtime checks disabled for app ($app)"
dokku_log_info2 "Zero downtime checks disabled for app ($app)"
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$app" DOKKU_CHECKS_SKIPPED="_all_"
fi
DOKKU_QUIET_OUTPUT=1 config_unset --no-restart "$app" DOKKU_CHECKS_ENABLED || true

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -434,7 +434,7 @@ func PropertyWrite(pluginName string, appName string, property string, value str
}
defer file.Close()
fmt.Fprintf(file, value)
fmt.Fprint(file, value)
file.Chmod(0600)
SetPermissions(propertyPath, 0600)
return nil

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core cron plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -42,7 +42,7 @@ trigger-docker-options-docker-args() {
case "$IMAGE_SOURCE_TYPE" in
dockerfile)
case "$line" in
--link* | -v*)
--link* | -v* | --volume*)
continue
;;

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

57
plugins/git/git-from-archive Executable file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-git-git-from-archive() {
declare desc="updates a repository from an archive"
declare trigger="git-from-archive"
declare APP="$1" ARCHIVE_URL="$2" ARCHIVE_TYPE="$3" USER_NAME="${4:-Dokku}" USER_EMAIL="${4:-automated@dokku.sh}"
local TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
local TMP_WORK_DIR_2=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
local TMP_WORK_DIR_3=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_WORK_DIR' '$TMP_WORK_DIR_2' '$TMP_WORK_DIR_3' >/dev/null" RETURN INT TERM EXIT
if [[ "$ARCHIVE_URL" == "--" ]]; then
dokku_log_info1 "Fetching $ARCHIVE_TYPE file from stdin"
tee "$TMP_WORK_DIR_2/src.$ARCHIVE_TYPE" | wc -c
else
dokku_log_info1 "Downloading $ARCHIVE_TYPE file from $ARCHIVE_URL"
curl -# -L "$ARCHIVE_URL" -o "$TMP_WORK_DIR_2/src.$ARCHIVE_TYPE"
fi
dokku_log_info1 "Generating build context"
if [[ "$ARCHIVE_TYPE" == "tar" ]]; then
local COMMON_PREFIX=$(tar -tf "$TMP_WORK_DIR_2/src.tar" | sed -e 'N;s/^\(.*\).*\n\1.*$/\1\n\1/;D')
local BOGUS_PARTS=$(echo "$COMMON_PREFIX " | awk 'BEGIN{FS="/"} {print NF-1}')
dokku_log_verbose "Striping $BOGUS_PARTS worth of directories from tarball"
tar -x -C "$TMP_WORK_DIR_3" -f "$TMP_WORK_DIR_2/src.tar" --strip-components="$BOGUS_PARTS"
elif [[ "$ARCHIVE_TYPE" == "tar.gz" ]]; then
dokku_log_verbose "Extracting gzipped tarball"
tar -x -C "$TMP_WORK_DIR_3" -f "$TMP_WORK_DIR_2/src.tar.gz" -z
elif [[ "$ARCHIVE_TYPE" == "zip" ]]; then
dokku_log_verbose "Extracting zipball"
unzip -d "$TMP_WORK_DIR_3" "$TMP_WORK_DIR_2/src.zip"
fi
chmod -R u+r "$TMP_WORK_DIR_3"
# drop any top-level folder components that resulted from the folder extraction
if [[ "$(find "$TMP_WORK_DIR_3" -maxdepth 1 -printf %y)" == "dd" ]]; then
dokku_log_verbose "Stripping top-level archive folder components"
local subpath="$(find "$TMP_WORK_DIR_3" -mindepth 1 -maxdepth 1 -type d)"
pushd "$subpath" >/dev/null
find . -maxdepth 1 -exec mv {} "$TMP_WORK_DIR" \;
popd &>/dev/null || pushd "/tmp" >/dev/null
else
dokku_log_verbose "Moving unarchived files and folders into place"
pushd "$TMP_WORK_DIR_3" >/dev/null
find . -maxdepth 1 -exec mv {} "$TMP_WORK_DIR" \;
popd &>/dev/null || pushd "/tmp" >/dev/null
fi
plugn trigger git-from-directory "$APP" "$TMP_WORK_DIR" "$USER_NAME" "$USER_EMAIL"
}
trigger-git-git-from-archive "$@"

32
plugins/git/git-from-image Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-git-git-from-image() {
declare desc="updates a repository from a docker image"
declare trigger="git-from-image"
declare APP="$1" DOCKER_IMAGE="$2" BUILD_DIR="$3" USER_NAME="${4:-Dokku}" USER_EMAIL="${4:-automated@dokku.sh}"
local TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
dokku_log_info1 "Generating build context"
if [[ -n "$BUILD_DIR" ]]; then
if [[ ! -d "$BUILD_DIR" ]]; then
dokku_log_fail "Invalid BUILD_DIR specified for docker build context"
fi
dokku_log_verbose "Syncing build directory context"
rsync -a "$BUILD_DIR/" "$TMP_WORK_DIR"
fi
dokku_log_verbose "Setting Dockerfile"
touch "$TMP_WORK_DIR/Dockerfile"
echo "FROM $DOCKER_IMAGE" >>"$TMP_WORK_DIR/Dockerfile"
echo "LABEL com.dokku.docker-image-labeler/alternate-tags=[\\\"$DOCKER_IMAGE\\\"]" >>"$TMP_WORK_DIR/Dockerfile"
plugn trigger git-from-directory "$APP" "$TMP_WORK_DIR" "$USER_NAME" "$USER_EMAIL"
}
trigger-git-git-from-image "$@"

View File

@@ -52,50 +52,7 @@ cmd-git-from-archive() {
dokku_log_fail "Invalid archive type specified, valid archive types include: tar, tar.gz, zip"
fi
local TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
local TMP_WORK_DIR_2=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
local TMP_WORK_DIR_3=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_WORK_DIR' '$TMP_WORK_DIR_2' '$TMP_WORK_DIR_3' >/dev/null" RETURN INT TERM EXIT
if [[ "$ARCHIVE_URL" == "--" ]]; then
dokku_log_info1 "Fetching $ARCHIVE_TYPE file from stdin"
tee "$TMP_WORK_DIR_2/src.$ARCHIVE_TYPE" | wc -c
else
dokku_log_info1 "Downloading $ARCHIVE_TYPE file from $ARCHIVE_URL"
curl -# -L "$ARCHIVE_URL" -o "$TMP_WORK_DIR_2/src.$ARCHIVE_TYPE"
fi
dokku_log_info1 "Generating build context"
if [[ "$ARCHIVE_TYPE" == "tar" ]]; then
local COMMON_PREFIX=$(tar -tf "$TMP_WORK_DIR_2/src.tar" | sed -e 'N;s/^\(.*\).*\n\1.*$/\1\n\1/;D')
local BOGUS_PARTS=$(echo "$COMMON_PREFIX " | awk 'BEGIN{FS="/"} {print NF-1}')
dokku_log_verbose "Striping $BOGUS_PARTS worth of directories from tarball"
tar -x -C "$TMP_WORK_DIR_3" -f "$TMP_WORK_DIR_2/src.tar" --strip-components="$BOGUS_PARTS"
elif [[ "$ARCHIVE_TYPE" == "tar.gz" ]]; then
dokku_log_verbose "Extracting gzipped tarball"
tar -x -C "$TMP_WORK_DIR_3" -f "$TMP_WORK_DIR_2/src.tar.gz" -z
elif [[ "$ARCHIVE_TYPE" == "zip" ]]; then
dokku_log_verbose "Extracting zipball"
unzip -d "$TMP_WORK_DIR_3" "$TMP_WORK_DIR_2/src.zip"
fi
chmod -R u+r "$TMP_WORK_DIR_3"
# drop any top-level folder components that resulted from the folder extraction
if [[ "$(find "$TMP_WORK_DIR_3" -maxdepth 1 -printf %y)" == "dd" ]]; then
dokku_log_verbose "Stripping top-level archive folder components"
local subpath="$(find "$TMP_WORK_DIR_3" -mindepth 1 -maxdepth 1 -type d)"
pushd "$subpath" >/dev/null
find . -maxdepth 1 -exec mv {} "$TMP_WORK_DIR" \;
popd &>/dev/null || pushd "/tmp" >/dev/null
else
dokku_log_verbose "Moving unarchived files and folders into place"
pushd "$TMP_WORK_DIR_3" >/dev/null
find . -maxdepth 1 -exec mv {} "$TMP_WORK_DIR" \;
popd &>/dev/null || pushd "/tmp" >/dev/null
fi
plugn trigger git-from-directory "$APP" "$TMP_WORK_DIR" "$USER_NAME" "$USER_EMAIL"
plugn trigger git-from-archive "$APP" "$ARCHIVE_URL" "$ARCHIVE_TYPE" "$USER_NAME" "$USER_EMAIL"
}
cmd-git-auth() {
@@ -152,25 +109,7 @@ cmd-git-from-image() {
verify_app_name "$APP"
[[ -z "$DOCKER_IMAGE" ]] && dokku_log_fail "Please specify a docker image"
local TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
dokku_log_info1 "Generating build context"
if [[ -n "$BUILD_DIR" ]]; then
if [[ ! -d "$BUILD_DIR" ]]; then
dokku_log_fail "Invalid BUILD_DIR specified for docker build context"
fi
dokku_log_verbose "Syncing build directory context"
rsync -a "$BUILD_DIR/" "$TMP_WORK_DIR"
fi
dokku_log_verbose "Setting Dockerfile"
touch "$TMP_WORK_DIR/Dockerfile"
echo "FROM $DOCKER_IMAGE" >>"$TMP_WORK_DIR/Dockerfile"
echo "LABEL com.dokku.docker-image-labeler/alternate-tags=[\\\"$DOCKER_IMAGE\\\"]" >>"$TMP_WORK_DIR/Dockerfile"
plugn trigger git-from-directory "$APP" "$TMP_WORK_DIR" "$USER_NAME" "$USER_EMAIL"
plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"
}
cmd-git-sync() {

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,6 +1,7 @@
package logs
import (
"bytes"
"encoding/json"
"errors"
"fmt"
@@ -128,23 +129,9 @@ func sinkValueToConfig(appName string, sinkValue string) (vectorSink, error) {
u.Scheme = strings.ReplaceAll(u.Scheme, "-", "_")
t := fmt.Sprintf("type=%s", u.Scheme)
i := fmt.Sprintf("inputs[]=docker-source:%s", appName)
if appName == "--global" {
i = "inputs[]=docker-global-source"
}
if appName == "--null" {
i = "inputs[]=docker-null-source"
}
initialQuery := fmt.Sprintf("%s&%s", t, i)
query := u.RawQuery
if query == "" {
query = initialQuery
} else if strings.HasPrefix(query, "&") {
query = fmt.Sprintf("%s%s", initialQuery, query)
} else {
query = fmt.Sprintf("%s&%s", initialQuery, query)
if strings.HasPrefix(query, "&") {
query = strings.TrimPrefix(query, "&")
}
b, err := qson.ToJSON(query)
@@ -156,6 +143,15 @@ func sinkValueToConfig(appName string, sinkValue string) (vectorSink, error) {
return data, err
}
data["type"] = u.Scheme
data["inputs"] = []string{"docker-source:" + appName}
if appName == "--global" {
data["inputs"] = []string{"docker-global-source"}
}
if appName == "--null" {
data["inputs"] = []string{"docker-null-source"}
}
return data, nil
}
@@ -222,6 +218,8 @@ func writeVectorConfig() error {
return err
}
b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1)
vectorConfig := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")
if err := common.WriteSliceToFile(vectorConfig, []string{string(b)}); err != nil {
return err

View File

@@ -24,7 +24,7 @@ var (
)
// VectorImage contains the default vector image to run
const VectorImage = "timberio/vector:0.12.X-debian"
const VectorImage = "timberio/vector:0.16.X-debian"
// GetFailedLogs outputs failed deploy logs for a given app
func GetFailedLogs(appName string) error {

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core logs plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -174,11 +174,14 @@ func GetContainerPort(appName, processType string, containerID string, isHerokui
break
}
}
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
cmd.Stderr = ioutil.Discard
b, err := cmd.Output()
if err == nil {
port = strings.Split(string(b[:]), ":")[1]
if port != "" {
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
cmd.Stderr = ioutil.Discard
b, err := cmd.Output()
if err == nil {
port = strings.Split(string(b[:]), ":")[1]
}
}
} else {
port = "5000"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core network plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -164,7 +164,7 @@ configure_nginx_ports() {
if [[ -z "$DOKKU_PROXY_PORT" ]] && [[ -z "$RAW_TCP_PORTS" ]]; then
if [[ "$IS_APP_VHOST_ENABLED" == "false" ]]; then
dokku_log_info1 "no proxy port set. setting to random open high port"
dokku_log_info1 "No proxy port set, setting to random open high port"
local PROXY_PORT=$(get_available_port)
else
local PROXY_PORT=$(config_get --global DOKKU_PROXY_PORT)
@@ -177,7 +177,7 @@ configure_nginx_ports() {
local PROXY_SSL_PORT=$(config_get --global DOKKU_PROXY_SSL_PORT)
PROXY_SSL_PORT=${PROXY_SSL_PORT:=443}
if [[ -z "$RAW_TCP_PORTS" ]] && [[ "$IS_APP_VHOST_ENABLED" == "false" ]]; then
dokku_log_info1 "no proxy ssl port set. setting to random open high port"
dokku_log_info1 "No proxy ssl port set, setting to random open high port"
PROXY_SSL_PORT=$(get_available_port)
fi
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_PROXY_SSL_PORT="$PROXY_SSL_PORT"
@@ -553,13 +553,13 @@ nginx_build_config() {
fi
else
# note because this clause is long. if the proxy is disabled:
dokku_log_info1 "nginx support is disabled for app ($APP)."
dokku_log_info1 "Nginx support is disabled for app ($APP)"
if [[ -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
dokku_log_info1 "deleting nginx.conf"
dokku_log_info1 "Deleting nginx.conf"
rm "$DOKKU_ROOT/$APP/nginx.conf"
if (is_deployed "$APP"); then
dokku_log_info1 "reloading nginx after nginx.conf deletion"
dokku_log_info1 "Reloading nginx after nginx.conf deletion"
validate_nginx && restart_nginx >/dev/null
fi
fi

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core nginx-vhosts plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core plugin plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core proxy plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ps plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core registry plugin"
version = "0.24.0"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core repo plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core resource plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core run plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
main() {
declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE="$3" IMAGE_TAG="$4" PROC_TYPE="$5" PROC_COUNT="$6"
local CONTAINER_INDEX=1
dokku_log_info1 "Deploying $PROC_TYPE (count=$PROC_COUNT)"
DOKKU_CHECKS_DISABLED="$(is_app_proctype_checks_disabled "$APP" "$PROC_TYPE")"
if [[ "$DOKKU_CHECKS_DISABLED" == "true" ]]; then
dokku_log_verbose "Zero downtime is disabled, stopping currently running containers ($PROC_TYPE)"
local cid proctype_oldids="$(get_app_running_container_ids "$APP" "$PROC_TYPE" 2>/dev/null)"
for cid in $proctype_oldids; do
dokku_log_verbose "Stopping $cid ($PROC_TYPE)"
# Retire the containers to ensure they get removed
plugn trigger scheduler-register-retired "$APP" "$cid" "$WAIT"
# Disable the container restart policy
"$DOCKER_BIN" container update --restart=no "$cid" &>/dev/null || true
# shellcheck disable=SC2086
"$DOCKER_BIN" container stop $DOCKER_STOP_TIME_ARG "$cid" &>/dev/null
done
fi
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]]; do
export DOKKU_CHECKS_DISABLED="$DOKKU_CHECKS_DISABLED"
"$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/bin/scheduler-deploy-process-container" "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE" "$IMAGE_TAG" "$PROC_TYPE" "$PROC_COUNT" "$CONTAINER_INDEX"
CONTAINER_INDEX=$((CONTAINER_INDEX + 1))
done
# cleanup when we scale down
if [[ "$PROC_COUNT" == 0 ]]; then
local CONTAINER_IDX_OFFSET=0
else
local CONTAINER_IDX_OFFSET=$((PROC_COUNT + 1))
fi
local container_state_filetype
for container_state_filetype in CONTAINER IP PORT; do
cd "$DOKKU_ROOT/$APP"
find . -maxdepth 1 -name "$container_state_filetype.$PROC_TYPE.*" -printf "%f\n" | sort -t . -k 3 -n | tail -n +$CONTAINER_IDX_OFFSET | xargs rm -f
done
}
main "$@"

View File

@@ -0,0 +1,116 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/internal-functions"
main() {
declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE="$3" IMAGE_TAG="$4" PROC_TYPE="$5" PROC_COUNT="$6" CONTAINER_INDEX="$7"
local cid=""
local port=""
local ipaddr=""
local DOKKU_CONTAINER_ID_FILE="$DOKKU_ROOT/$APP/CONTAINER.$PROC_TYPE.$CONTAINER_INDEX"
local DYNO="$PROC_TYPE.$CONTAINER_INDEX"
# start the app
local DOCKER_ARGS
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
DOCKER_ARGS+=" --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO"
DOCKER_ARGS+=" --env=DYNO=$DYNO"
DOCKER_ARGS+=" --name=$APP.$DYNO.upcoming-$RANDOM"
DOCKER_ARGS+=" --init"
DOCKER_ARGS+=" $DOCKER_RUN_LABEL_ARGS $DOKKU_GLOBAL_RUN_ARGS "
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true"
local START_CMD
[[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE"
[[ "$DOKKU_CNB" == "true" ]] && START_CMD=""
[[ -n "$DOKKU_START_CMD" ]] && START_CMD="$DOKKU_START_CMD"
local DOKKU_PORT=""
if [[ "$PROC_TYPE" == "web" ]]; then
ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$CONTAINER_INDEX"))
local DOKKU_DOCKER_PORT_ARGS=""
for p in "${ports[@]}"; do
if [[ ! "$p" =~ .*udp.* ]]; then
DOKKU_PORT=${DOKKU_PORT:="$p"}
fi
if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then
DOCKER_ARGS+=" -p $p"
fi
done
fi
DOCKER_ARGS+=" --env=PORT=$DOKKU_PORT"
START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH" "$DOKKU_PORT")
DOCKER_ARGS+=" $IMAGE"
DOCKER_ARGS+=" $START_CMD"
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
cid=$(fn-scheduler-docker-local-start-app-container "$APP" "${ARG_ARRAY[@]}")
plugn trigger post-container-create "app" "$cid" "$APP" "deploy" "$PROC_TYPE"
"$DOCKER_BIN" container start "$cid" >/dev/null || true
ipaddr=$(plugn trigger network-get-ipaddr "$APP" "$PROC_TYPE" "$cid")
port=$(plugn trigger network-get-port "$APP" "$PROC_TYPE" "$cid" "$DOKKU_HEROKUISH")
kill_new() {
declare desc="wrapper function to kill newly started app container"
declare CID="$1" PROC_TYPE="$2" CONTAINER_INDEX="$3"
plugn trigger scheduler-register-retired "$APP" "$CID" "$WAIT"
mkdir -p "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP"
echo "${CID} ${PROC_TYPE}.${CONTAINER_INDEX}" >>"${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers"
"$DOCKER_BIN" container inspect "$CID" &>/dev/null && {
# Disable the container restart policy
"$DOCKER_BIN" container update --restart=no "$CID" &>/dev/null || true
"$DOCKER_BIN" container stop "$CID" >/dev/null && "$DOCKER_BIN" container kill "$CID" &>/dev/null
}
trap - INT TERM EXIT
kill -9 $$
}
# run checks first, then post-deploy hooks, which switches proxy traffic
trap "kill_new $cid $PROC_TYPE $CONTAINER_INDEX" INT TERM EXIT
if [[ "$DOKKU_CHECKS_DISABLED" == "false" ]]; then
dokku_log_verbose "Attempting pre-flight checks ($PROC_TYPE.$CONTAINER_INDEX)"
plugn trigger check-deploy "$APP" "$cid" "$PROC_TYPE" "$port" "$ipaddr" "$CONTAINER_INDEX"
fi
trap - INT TERM EXIT
if [[ -f "$DOKKU_CONTAINER_ID_FILE" ]]; then
# schedule old container for retirement
dokku_log_verbose "Scheduling old container shutdown in $WAIT seconds ($PROC_TYPE.$CONTAINER_INDEX)"
plugn trigger scheduler-register-retired "$APP" "$(cat "$DOKKU_CONTAINER_ID_FILE")" "$WAIT"
fi
# now using the new container
[[ -n "$cid" ]] && echo "$cid" >"$DOKKU_CONTAINER_ID_FILE"
[[ -n "$ipaddr" ]] && plugn trigger network-write-ipaddr "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$ipaddr"
[[ -n "$port" ]] && plugn trigger network-write-port "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$port"
# cleanup pre-migration files
rm -f "$DOKKU_ROOT/$APP/CONTAINER" "$DOKKU_ROOT/$APP/IP" "$DOKKU_ROOT/$APP/PORT"
}
fn-scheduler-docker-local-extract-start-cmd() {
declare APP="$1" PROC_TYPE="$2" START_CMD="$3" DOKKU_HEROKUISH="$4" PORT="$5"
local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD
if [[ "$DOKKU_HEROKUISH" != "false" ]] && [[ -n "$START_CMD" ]]; then
echo "$START_CMD"
return
fi
DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true)
DOKKU_PROCFILE_START_CMD=$(plugn trigger procfile-get-command "$APP" "$PROC_TYPE" "$PORT" 2>/dev/null || echo '')
START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD}
echo "$START_CMD"
}
main "$@"

View File

@@ -42,7 +42,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-scheduler-docker-local-check-deploy() {
declare desc="scheduler-docker-local check-deploy plugin trigger"
declare trigger="check-deploy"
declare APP="$1" DOKKU_APP_CONTAINER_ID="$2" DOKKU_APP_CONTAINER_TYPE="$3" DOKKU_APP_LISTEN_PORT="$4" DOKKU_APP_LISTEN_IP="$5"
declare APP="$1" DOKKU_APP_CONTAINER_ID="$2" DOKKU_APP_CONTAINER_TYPE="$3" DOKKU_APP_LISTEN_PORT="$4" DOKKU_APP_LISTEN_IP="$5" CONTAINER_INDEX="$6"
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
@@ -65,7 +65,7 @@ trigger-scheduler-docker-local-check-deploy() {
eval "$(config_export app "$APP")"
if [[ "$(is_app_proctype_checks_skipped "$APP" "$DOKKU_APP_CONTAINER_TYPE")" == "true" ]]; then
dokku_log_info2_quiet "Zero downtime checks for app ($APP) have been skipped. moving on..."
dokku_log_info2_quiet "Zero downtime checks have been skipped ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
exit 0
fi
@@ -87,9 +87,9 @@ trigger-scheduler-docker-local-check-deploy() {
local id="$1"
rm -rf "$CHECK_DEPLOY_TMP_WORK_DIR" &>/dev/null || true
if [[ $id ]]; then
dokku_log_info2_quiet "$APP $DOKKU_APP_CONTAINER_TYPE container output:"
dokku_log_info2_quiet "Start of $APP container output ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
dokku_container_log_verbose_quiet "$id"
dokku_log_info2_quiet "end $APP $DOKKU_APP_CONTAINER_TYPE container output"
dokku_log_info2_quiet "End of $APP container output ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
fi
}
trap "checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID" RETURN INT TERM EXIT
@@ -100,19 +100,19 @@ trigger-scheduler-docker-local-check-deploy() {
# simple default check to see if the container stuck around
local DOKKU_DEFAULT_CHECKS_WAIT="${DOKKU_DEFAULT_CHECKS_WAIT:-10}"
dokku_log_verbose "Waiting for $DOKKU_DEFAULT_CHECKS_WAIT seconds ..."
dokku_log_verbose "Waiting for $DOKKU_DEFAULT_CHECKS_WAIT seconds ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
sleep "$DOKKU_DEFAULT_CHECKS_WAIT"
! (is_container_status "$DOKKU_APP_CONTAINER_ID" "Running") && dokku_log_fail "App container failed to start!!"
! (is_container_status "$DOKKU_APP_CONTAINER_ID" "Running") && dokku_log_fail "App container failed to start ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
local container_restarts="$("$DOCKER_BIN" container inspect --format "{{ .RestartCount }}" "$DOKKU_APP_CONTAINER_ID")"
if [[ $container_restarts -ne 0 ]]; then
"$DOCKER_BIN" container update --restart=no "$DOKKU_APP_CONTAINER_ID" &>/dev/null || true
"$DOCKER_BIN" container stop "$DOKKU_APP_CONTAINER_ID" || true
dokku_log_fail "App container failed to start!!"
dokku_log_fail "App container failed to start ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
fi
trap - EXIT
dokku_log_verbose "Default container check successful!" && exit 0
dokku_log_verbose "Default container check successful ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)" && exit 0
fi
local NEW_CHECKS_FILENAME="${CHECK_DEPLOY_TMP_WORK_DIR}/NEW_CHECKS"
@@ -194,15 +194,13 @@ trigger-scheduler-docker-local-check-deploy() {
# CURL_ARGS includes the behinds the scenes options for hitting the container service directly
local CURL_ARGS="$CURL_OPTIONS $URL_PROTOCOL://$DOKKU_APP_LISTEN_IP:$DOKKU_APP_LISTEN_PORT$URL_PATHNAME $HEADERS"
dokku_log_verbose "CHECKS expected result:"
dokku_log_verbose "$LOG_URL => \"$EXPECTED\""
[[ $DOKKU_TRACE ]] && dokku_log_verbose "$ curl $CURL_ARGS"
dokku_log_verbose "CHECKS expected result: $LOG_URL => \"$EXPECTED\" ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
local ATTEMPT=0
local SUCCESS=0
until [[ $SUCCESS == 1 || $ATTEMPT -ge $ATTEMPTS ]]; do
local ATTEMPT=$((ATTEMPT + 1))
dokku_log_verbose "Attempt $ATTEMPT/$ATTEMPTS. Waiting for $WAIT seconds ..."
dokku_log_verbose "Attempt $ATTEMPT/$ATTEMPTS. Waiting for $WAIT seconds ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
sleep "$WAIT"
# Capture HTTP response or CURL error message
@@ -214,13 +212,13 @@ trigger-scheduler-docker-local-check-deploy() {
SUCCESS=1
break
fi
dokku_log_warn "$LOG_URL: expected to but did not find: \"$EXPECTED\""
dokku_log_warn "$LOG_URL: expected to but did not find: \"$EXPECTED\" ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
else
# Failed to connect/no response, OUTPUT contains error message
dokku_log_warn "$OUTPUT"
fi
dokku_log_warn "Check attempt $ATTEMPT/$ATTEMPTS failed."
dokku_log_warn "Check attempt $ATTEMPT/$ATTEMPTS failed ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
done
if [[ $SUCCESS -ne 1 ]]; then
@@ -229,12 +227,12 @@ trigger-scheduler-docker-local-check-deploy() {
done
if [[ $FAILEDCHECKS -gt 0 ]]; then
dokku_log_fail "Could not start due to $FAILEDCHECKS failed checks."
dokku_log_fail "Could not start due to $FAILEDCHECKS failed checks ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
exit 1
fi
trap - EXIT
dokku_log_verbose "All checks successful!"
dokku_log_verbose "All checks successful ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
}
trigger-scheduler-docker-local-check-deploy "$@"

View File

@@ -55,8 +55,13 @@ trigger-scheduler-docker-local-core-post-deploy() {
local ID=$(cat "$container")
local CURRENT_NAME=$("$DOCKER_BIN" container inspect --format '{{.Name}}' "$ID" | tr -d /)
if [[ -n "$CURRENT_NAME" ]]; then
dokku_log_verbose_quiet "Renaming container (${ID:0:12}) $CURRENT_NAME to $NAME"
"$DOCKER_BIN" container rename "$CURRENT_NAME" "$NAME" >/dev/null
dokku_log_verbose_quiet "Renaming container $CURRENT_NAME (${ID:0:12}) to $NAME"
if ! "$DOCKER_BIN" container rename "$ID" "$NAME" >/dev/null; then
dokku_log_warn "Failed to rename container $CURRENT_NAME (${ID:0:12})"
dokku_log_info2_quiet "Start $APP (${ID:0:12}) container output:"
dokku_container_log_verbose_quiet "$ID"
dokku_log_info2_quiet "End $APP (${ID:0:12}) container output"
fi
fi
done
shopt -u nullglob

View File

@@ -38,6 +38,7 @@ cmd-scheduler-docker-local-report-single() {
verify_app_name "$APP"
local flag_map=(
"--scheduler-docker-local-disable-chown: $(fn-plugin-property-get "scheduler-docker-local" "$APP" "disable-chown" "")"
"--scheduler-docker-local-parallel-schedule-count: $(fn-plugin-property-get "scheduler-docker-local" "$APP" "parallel-schedule-count" "")"
)
if [[ -z "$INFO_FLAG" ]]; then
@@ -238,10 +239,16 @@ fn-scheduler-docker-local-register-retired() {
fn-scheduler-docker-local-start-app-container() {
declare desc="starts a single app container"
declare APP="$1" DOCKER_ARGS="$2"
declare APP="$1"
shift
local DOCKER_ARGS
for i in "$@"; do
DOCKER_ARGS="$DOCKER_ARGS \"$i\""
done
eval set -- $DOCKER_ARGS
declare -a __DOKKU_DOCKER_ARG_ARRAY
eval "__DOKKU_DOCKER_ARG_ARRAY=($DOCKER_ARGS)"
eval "$(config_export app "$APP" --merged)"
"$DOCKER_BIN" container create "${__DOKKU_DOCKER_ARG_ARRAY[@]}"
# shellcheck disable=SC2124
"$DOCKER_BIN" container create "$@"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core scheduler-docker-local plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -37,7 +37,7 @@ scheduler-docker-local-pre-deploy-chown-app() {
CONTAINER_PATHS=$(echo "$APP_PATHS" | awk -F ':' '{ print $2 }' | xargs)
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
filterdArgs=("--cpus" "--gpus" "--memory" "--memory-reservation" "--memory-swap" "--publish" "--publish-all" "-p" "-P")
filterdArgs=("--cpus" "--gpus" "--memory" "--memory-reservation" "--memory-swap" "--publish" "--publish-all" "-p" "-P" "--restart")
for filteredArg in "${filterdArgs[@]}"; do
# shellcheck disable=SC2001
DOCKER_ARGS=$(sed -e "s/$filteredArg=[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")

View File

@@ -21,7 +21,7 @@ trigger-scheduler-docker-local-scheduler-deploy() {
local DOKKU_DOCKER_STOP_TIMEOUT DOKKU_HEROKUISH DOKKU_NETWORK_BIND_ALL IMAGE
DOKKU_HEROKUISH=false
DOKKU_CNB=false
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
IMAGE="$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")"
is_image_cnb_based "$IMAGE" && DOKKU_CNB=true
is_image_herokuish_based "$IMAGE" "$APP" && DOKKU_HEROKUISH=true
@@ -44,138 +44,28 @@ trigger-scheduler-docker-local-scheduler-deploy() {
local WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
local TMP_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_FILE' >/dev/null" RETURN INT TERM
local line
local PROC_TYPE
local PROC_COUNT
local CONTAINER_INDEX
while read -r line || [[ -n "$line" ]]; do
PROC_TYPE=${line%%=*}
PROC_COUNT=${line#*=}
CONTAINER_INDEX=1
local PROC_TYPE=${line%%=*}
local PROC_COUNT=${line#*=}
if [[ "$(is_app_proctype_checks_disabled "$APP" "$PROC_TYPE")" == "true" ]]; then
dokku_log_info1 "Zero downtime is disabled for app ($APP.$PROC_TYPE), Stopping currently running containers"
local cid proctype_oldids="$(get_app_running_container_ids "$APP" "$PROC_TYPE" 2>/dev/null)"
for cid in $proctype_oldids; do
dokku_log_verbose "Stopping $APP.$PROC_TYPE ($cid)"
# Retire the containers to ensure they get removed
plugn trigger scheduler-register-retired "$APP" "$cid" "$WAIT"
# Disable the container restart policy
"$DOCKER_BIN" container update --restart=no "$cid" &>/dev/null || true
# shellcheck disable=SC2086
"$DOCKER_BIN" container stop $DOCKER_STOP_TIME_ARG "$cid" &>/dev/null
# remove cid from oldids to skip the old container finish processing
oldids="$(remove_val_from_list "$cid" "$oldids" " ")"
done
if [[ "$PROC_TYPE" != "web" ]]; then
echo "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/bin/scheduler-deploy-process $APP $IMAGE_SOURCE_TYPE $IMAGE $IMAGE_TAG $PROC_TYPE $PROC_COUNT" >>"$TMP_FILE"
continue
fi
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]]; do
local cid=""
local port=""
local ipaddr=""
local DOKKU_CONTAINER_ID_FILE="$DOKKU_ROOT/$APP/CONTAINER.$PROC_TYPE.$CONTAINER_INDEX"
local DYNO="$PROC_TYPE.$CONTAINER_INDEX"
# start the app
local DOCKER_ARGS
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
DOCKER_ARGS+=" --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO "
DOCKER_ARGS+=" --env=DYNO=$DYNO "
DOCKER_ARGS+=" --init "
DOCKER_ARGS+=" $DOCKER_RUN_LABEL_ARGS $DOKKU_GLOBAL_RUN_ARGS "
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
local START_CMD
[[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE"
[[ "$DOKKU_CNB" == "true" ]] && START_CMD=""
[[ -n "$DOKKU_START_CMD" ]] && START_CMD="$DOKKU_START_CMD"
local DOKKU_PORT=""
if [[ "$PROC_TYPE" == "web" ]]; then
ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$CONTAINER_INDEX"))
local DOKKU_DOCKER_PORT_ARGS=""
for p in "${ports[@]}"; do
if [[ ! "$p" =~ .*udp.* ]]; then
DOKKU_PORT=${DOKKU_PORT:="$p"}
fi
if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then
DOCKER_ARGS+=" -p $p "
fi
done
fi
DOCKER_ARGS+=" --env=PORT=$DOKKU_PORT "
START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH" "$DOKKU_PORT")
DOCKER_ARGS+=" $IMAGE "
DOCKER_ARGS+=" $START_CMD "
cid=$(fn-scheduler-docker-local-start-app-container "$APP" "$DOCKER_ARGS")
plugn trigger post-container-create "app" "$cid" "$APP" "deploy" "$PROC_TYPE"
"$DOCKER_BIN" container start "$cid" >/dev/null || true
ipaddr=$(plugn trigger network-get-ipaddr "$APP" "$PROC_TYPE" "$cid")
port=$(plugn trigger network-get-port "$APP" "$PROC_TYPE" "$cid" "$DOKKU_HEROKUISH")
kill_new() {
declare desc="wrapper function to kill newly started app container"
declare CID="$1" PROC_TYPE="$2" CONTAINER_INDEX="$3"
plugn trigger scheduler-register-retired "$APP" "$CID" "$WAIT"
mkdir -p "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP"
echo "${CID} ${PROC_TYPE}.${CONTAINER_INDEX}" >>"${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers"
"$DOCKER_BIN" container inspect "$CID" &>/dev/null && {
# Disable the container restart policy
"$DOCKER_BIN" container update --restart=no "$CID" &>/dev/null || true
"$DOCKER_BIN" container stop "$CID" >/dev/null && "$DOCKER_BIN" container kill "$CID" &>/dev/null
}
trap - INT TERM EXIT
kill -9 $$
}
# run checks first, then post-deploy hooks, which switches proxy traffic
trap "kill_new $cid $PROC_TYPE $CONTAINER_INDEX" INT TERM EXIT
if [[ "$(is_app_proctype_checks_disabled "$APP" "$PROC_TYPE")" == "false" ]]; then
dokku_log_info1 "Attempting pre-flight checks ($PROC_TYPE.$CONTAINER_INDEX)"
plugn trigger check-deploy "$APP" "$cid" "$PROC_TYPE" "$port" "$ipaddr"
fi
trap - INT TERM EXIT
if [[ -f "$DOKKU_CONTAINER_ID_FILE" ]]; then
# schedule old container for retirement
dokku_log_verbose "Scheduling old container shutdown for $PROC_TYPE.$CONTAINER_INDEX in $WAIT seconds"
plugn trigger scheduler-register-retired "$APP" "$(cat "$DOKKU_CONTAINER_ID_FILE")" "$WAIT"
fi
# now using the new container
[[ -n "$cid" ]] && echo "$cid" >"$DOKKU_CONTAINER_ID_FILE"
[[ -n "$ipaddr" ]] && plugn trigger network-write-ipaddr "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$ipaddr"
[[ -n "$port" ]] && plugn trigger network-write-port "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$port"
# cleanup pre-migration files
rm -f "$DOKKU_ROOT/$APP/CONTAINER" "$DOKKU_ROOT/$APP/IP" "$DOKKU_ROOT/$APP/PORT"
local CONTAINER_INDEX=$((CONTAINER_INDEX + 1))
done
# cleanup when we scale down
if [[ "$PROC_COUNT" == 0 ]]; then
local CONTAINER_IDX_OFFSET=0
else
local CONTAINER_IDX_OFFSET=$((PROC_COUNT + 1))
fi
local container_state_filetype
for container_state_filetype in CONTAINER IP PORT; do
cd "$DOKKU_ROOT/$APP"
find . -maxdepth 1 -name "$container_state_filetype.$PROC_TYPE.*" -printf "%f\n" | sort -t . -k 3 -n | tail -n +$CONTAINER_IDX_OFFSET | xargs rm -f
done
DOKKU_NETWORK_BIND_ALL="$DOKKU_NETWORK_BIND_ALL" DOKKU_HEROKUISH="$DOKKU_HEROKUISH" DOKKU_CNB="$DOKKU_CNB" DOCKER_RUN_LABEL_ARGS="$DOCKER_RUN_LABEL_ARGS" DOKKU_START_CMD="$DOKKU_START_CMD" DOCKER_STOP_TIME_ARG="$DOCKER_STOP_TIME_ARG" "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/bin/scheduler-deploy-process" "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE" "$IMAGE_TAG" "$PROC_TYPE" "$PROC_COUNT"
done < <(plugn trigger ps-current-scale "$APP")
PARALLEL_DEPLOY_COUNT="$(fn-plugin-property-get "scheduler-docker-local" "$APP" "parallel-schedule-count" "1")"
DOKKU_NETWORK_BIND_ALL="$DOKKU_NETWORK_BIND_ALL" DOKKU_HEROKUISH="$DOKKU_HEROKUISH" DOKKU_CNB="$DOKKU_CNB" DOCKER_RUN_LABEL_ARGS="$DOCKER_RUN_LABEL_ARGS" DOKKU_START_CMD="$DOKKU_START_CMD" DOCKER_STOP_TIME_ARG="$DOCKER_STOP_TIME_ARG" parallel --halt soon,fail=1 --jobs "$PARALLEL_DEPLOY_COUNT" --ungroup <"$TMP_FILE"
dokku_log_info1 "Running post-deploy"
plugn trigger core-post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"
plugn trigger post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"
@@ -189,6 +79,9 @@ trigger-scheduler-docker-local-scheduler-deploy() {
trap '' INT HUP
sleep "$WAIT"
for oldid in $oldids; do
if ! docker container inspect "$oldid" >/dev/null 2>&1; then
continue
fi
# Disable the container restart policy
"$DOCKER_BIN" container update --restart=no "$oldid" &>/dev/null || true
@@ -208,18 +101,4 @@ trigger-scheduler-docker-local-scheduler-deploy() {
fi
}
fn-scheduler-docker-local-extract-start-cmd() {
declare APP="$1" PROC_TYPE="$2" START_CMD="$3" DOKKU_HEROKUISH="$4" PORT="$5"
local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD
if [[ "$DOKKU_HEROKUISH" != "false" ]] && [[ -n "$START_CMD" ]]; then
echo "$START_CMD"
return
fi
DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true)
DOKKU_PROCFILE_START_CMD=$(plugn trigger procfile-get-command "$APP" "$PROC_TYPE" "$PORT")
START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD}
echo "$START_CMD"
}
trigger-scheduler-docker-local-scheduler-deploy "$@"

View File

@@ -14,12 +14,12 @@ trigger-scheduler-docker-local-scheduler-run() {
declare RUN_ENV=("${@:1:ENV_COUNT}")
shift "$ENV_COUNT"
declare RUN_COMMAND=()
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
return
fi
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
local IMAGE_TAG=$(get_running_image_tag "$APP")
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
@@ -44,13 +44,13 @@ trigger-scheduler-docker-local-scheduler-run() {
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG")
DOCKER_ARGS+=" -e DYNO=$PROCESS_TYPE.$DYNO_NUMBER --name $APP.$PROCESS_TYPE.$DYNO_NUMBER"
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
if [[ "$DOKKU_RM_CONTAINER" ]]; then
DOCKER_ARGS+=" --rm"
fi
has_tty && DOCKER_ARGS+=" --interactive --tty"
if has_tty; then
DOCKER_ARGS+=" --interactive"
DOCKER_ARGS+=" --tty"
fi
for env_pair in "${RUN_ENV[@]}"; do
DOCKER_ARGS+=" --env=$env_pair"
done
@@ -76,13 +76,35 @@ trigger-scheduler-docker-local-scheduler-run() {
fi
# shellcheck disable=SC2124
DOCKER_ARGS+=" --label=com.dokku.container-type=$PROCESS_TYPE ${DOCKER_RUN_LABEL_ARGS[@]} $DOKKU_GLOBAL_RUN_ARGS"
DOCKER_ARGS+=" $IMAGE "
DOCKER_ARGS+=" $EXEC_CMD "
# shellcheck disable=SC2124
DOCKER_ARGS+=" $@"
DOCKER_ARGS+=" --label=com.dokku.container-type=$PROCESS_TYPE"
DOCKER_ARGS+=" --label=com.dokku.app-name=$APP"
# $DOKKU_GLOBAL_RUN_ARGS"
DOCKER_ARGS+=" $IMAGE"
DOCKER_ARGS+=" $EXEC_CMD"
CONTAINER_ID=$(fn-scheduler-docker-local-start-app-container "$APP" "$DOCKER_ARGS")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
RUN_COMMAND=("$@")
if [[ "${#RUN_COMMAND[@]}" -eq 0 ]]; then
if [[ -z "$DOKKU_SHELL" ]]; then
local DOKKU_APP_SHELL=$(config_get "$APP" DOKKU_APP_SHELL || true)
local DOKKU_GLOBAL_SHELL=$(config_get --global DOKKU_APP_SHELL || true)
local DOKKU_SHELL=${DOKKU_APP_SHELL:="$DOKKU_GLOBAL_SHELL"}
fi
if [[ -z "$DOKKU_SHELL" ]]; then
DOKKU_SHELL="/bin/bash"
fi
ARG_ARRAY=("${ARG_ARRAY[@]}" "$DOKKU_SHELL")
else
ARG_ARRAY=("${ARG_ARRAY[@]}" "${RUN_COMMAND[@]}")
# for run_arg in "${RUN_COMMAND[@]}"; do
# DOCKER_ARGS+=" ${run_arg} "
# done
fi
CONTAINER_ID=$(fn-scheduler-docker-local-start-app-container "$APP" "${ARG_ARRAY[@]}")
plugn trigger post-container-create "app" "$CONTAINER_ID" "$APP" "run"
declare -a DOCKER_START_ARGS_ARRAY

View File

@@ -9,13 +9,13 @@ cmd-scheduler-docker-local-set() {
declare cmd="scheduler-docker-local:set"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" KEY="$2" VALUE="$3"
local VALID_KEYS=("disable-chown")
local VALID_KEYS=("disable-chown" "parallel-schedule-count")
verify_app_name "$APP"
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
dokku_log_fail "Invalid key specified, valid keys include: disable-chown"
dokku_log_fail "Invalid key specified, valid keys include: disable-chown, parallel-schedule-count"
fi
if [[ -n "$VALUE" ]]; then

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core scheduler-null plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core shell plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ssh-keys plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
main() {
declare desc="chowns a storage directory"
declare DIRECTORY="$1" CHOWN_ID="$2"
if [[ -z "$DIRECTORY" ]]; then
echo " ! Please specify a directory to create" 1>&2
exit 1
fi
if [[ ! "$DIRECTORY" =~ ^[A-Za-z0-9\\_-]+$ ]]; then
echo " ! Directory can only contain the following set of characters: [A-Za-z0-9_-]" 1>&2
exit 1
fi
if [[ "$CHOWN_ID" != "32767" ]] && [[ "$CHOWN_ID" != "1000" ]] && [[ "$CHOWN_ID" != "2000" ]]; then
echo " ! Unsupported chown permissions. Supported values: 32767, 1000, 2000"
exit 1
fi
chown -R "$CHOWN_ID:$CHOWN_ID" "${DOKKU_LIB_ROOT}/data/storage/$DIRECTORY"
}
main "$@"

View File

@@ -27,6 +27,7 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
storage:ensure-directory [--chown option] <directory>, Creates a persistent storage directory in the recommended storage path
storage:list <app>, List bind mounts for app's container(s) (host:container)
storage:mount <app> <host-dir:container-dir>, Create a new bind mount
storage:report [<app>] [<flag>], Displays a checks report for one or more apps

View File

@@ -5,9 +5,40 @@ set -eo pipefail
trigger-storage-install() {
declare desc="storage install trigger"
declare trigger="install"
local storage_directory="${DOKKU_LIB_ROOT}/data/storage"
mkdir -p "${storage_directory}"
chown dokku:dokku "${storage_directory}"
mkdir -p "${DOKKU_LIB_ROOT}/data/storage"
chown dokku:dokku "${DOKKU_LIB_ROOT}/data/storage"
STORAGE_SUDOERS_FILE="/etc/sudoers.d/dokku-storage"
case "$DOKKU_DISTRO" in
debian)
echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE"
echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE"
;;
ubuntu)
echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE"
echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE"
;;
opensuse)
echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE"
echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE"
;;
arch)
echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE"
echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE"
;;
centos | fedora | rhel)
echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE"
echo "Defaults:dokku !requiretty" >>"$STORAGE_SUDOERS_FILE"
echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE"
;;
esac
}
trigger-storage-install "$@"

View File

@@ -5,6 +5,62 @@ source "$PLUGIN_AVAILABLE_PATH/storage/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
cmd-storage-ensure-directory() {
declare desc="creates a persistent storage directory in the recommended storage path"
declare cmd="storage:ensure-directory"
[[ "$1" == "$cmd" ]] && shift 1
declare DIRECTORY CHOWN_FLAG
CHOWN_FLAG=herokuish
skip=false
for arg in "$@"; do
if [[ "$arg" == "--chown" ]]; then
skip=true
continue
fi
if [[ "$skip" == "true" ]]; then
CHOWN_FLAG="$arg"
skip=false
continue
fi
if [[ -z "$DIRECTORY" ]]; then
DIRECTORY="$arg"
fi
done
if [[ -z "$DIRECTORY" ]]; then
dokku_log_fail "Please specify a directory to create"
fi
if [[ ! "$DIRECTORY" =~ ^[A-Za-z0-9\\_-]+$ ]]; then
dokku_log_fail "Directory can only contain the following set of characters: [A-Za-z0-9_-]"
fi
if [[ "$CHOWN_FLAG" == "herokuish" ]]; then
CHOWN_FLAG="32767"
elif [[ "$CHOWN_FLAG" == "heroku" ]]; then
CHOWN_FLAG="1000"
elif [[ "$CHOWN_FLAG" == "packeto" ]]; then
CHOWN_FLAG="2000"
elif [[ "$CHOWN_FLAG" == "false" ]]; then
CHOWN_FLAG="false"
else
dokku_log_fail "Unsupported chown permissions"
fi
local storage_directory="${DOKKU_LIB_ROOT}/data/storage/$DIRECTORY"
dokku_log_info1 "Ensuring ${storage_directory} exists"
mkdir -p "${storage_directory}"
if [[ "$CHOWN_FLAG" != "false" ]]; then
dokku_log_verbose_quiet "Setting directory ownership to $CHOWN_FLAG:$CHOWN_FLAG"
sudo "$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir" "$DIRECTORY" "$CHOWN_FLAG"
fi
dokku_log_verbose_quiet "Directory ready for mounting"
}
cmd-storage-report() {
declare desc="displays a storage report for one or more apps"
declare cmd="storage:report"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core storage plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/storage/internal-functions"
cmd-storage-ensure-directory "$@"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core tags plugin"
version = "0.25.2"
version = "0.25.6"
[plugin.config]

Some files were not shown because too many files have changed in this diff Show More