Compare commits
114 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d883f53c7 | ||
|
|
a25071f02f | ||
|
|
5f5efe2563 | ||
|
|
fa1f3d0a08 | ||
|
|
0720c3ef66 | ||
|
|
ea86a9f2ca | ||
|
|
4cf717baf8 | ||
|
|
bab3e714f7 | ||
|
|
74b2961f8d | ||
|
|
76201aed64 | ||
|
|
9e27b07772 | ||
|
|
51c5c58354 | ||
|
|
2d1b93c354 | ||
|
|
f945696d15 | ||
|
|
4687b96003 | ||
|
|
92524c2da0 | ||
|
|
a5ea0ba896 | ||
|
|
b7c7155852 | ||
|
|
fd28bf53de | ||
|
|
52d9cb6188 | ||
|
|
5dcdce8b62 | ||
|
|
b41b5c0a68 | ||
|
|
a9f820bfaa | ||
|
|
a2e40de597 | ||
|
|
2fa7baa035 | ||
|
|
177f0be21c | ||
|
|
c29def79f3 | ||
|
|
8fb50bbf68 | ||
|
|
ed9d356f60 | ||
|
|
a4be3a06f9 | ||
|
|
e636609fa8 | ||
|
|
1d1cf56692 | ||
|
|
82778a0aad | ||
|
|
3d239344fe | ||
|
|
c266d8c41e | ||
|
|
6f2c218f29 | ||
|
|
abfb0d3977 | ||
|
|
9a1a97d56f | ||
|
|
44caf44ce6 | ||
|
|
e800b8a9a7 | ||
|
|
4d0ff4a834 | ||
|
|
ce4fe7850b | ||
|
|
869a6ce553 | ||
|
|
43b90f1ae8 | ||
|
|
3e694926c9 | ||
|
|
1c277a99cb | ||
|
|
071416ef11 | ||
|
|
5502a61452 | ||
|
|
96924e54c4 | ||
|
|
8cff88dea0 | ||
|
|
fbff08a580 | ||
|
|
9b45aed6f0 | ||
|
|
d9eea74f18 | ||
|
|
301d5a19b0 | ||
|
|
8cb4bb74fa | ||
|
|
61447f9ffd | ||
|
|
06742cfcc4 | ||
|
|
82dfcc01e2 | ||
|
|
892391a7fd | ||
|
|
44a43cb130 | ||
|
|
e00c98546f | ||
|
|
27e2f7ab3d | ||
|
|
eadf9f1f8e | ||
|
|
597fb7d219 | ||
|
|
e27d19a346 | ||
|
|
15bf4a8386 | ||
|
|
003ed01e30 | ||
|
|
db239debf1 | ||
|
|
fccd4e1a20 | ||
|
|
0c8c093cf7 | ||
|
|
f74b702c5e | ||
|
|
75309bf3a0 | ||
|
|
dc310c4ce4 | ||
|
|
0aa3c3fa53 | ||
|
|
2d180f5e0f | ||
|
|
d83471bd46 | ||
|
|
974f601fa9 | ||
|
|
4a8ed5cd06 | ||
|
|
709d8d411c | ||
|
|
e79b750b6d | ||
|
|
bb4a2da52e | ||
|
|
79bb5cb9a7 | ||
|
|
70877e351c | ||
|
|
8877abb83f | ||
|
|
cdc5eb9909 | ||
|
|
e1482df157 | ||
|
|
b45b2db8e7 | ||
|
|
d21efd90b4 | ||
|
|
d82a259bab | ||
|
|
6f64a59f49 | ||
|
|
d67aa94709 | ||
|
|
f8376c8845 | ||
|
|
52f3cf2af0 | ||
|
|
0997fd3347 | ||
|
|
2c4fec77bb | ||
|
|
2a04ed70b6 | ||
|
|
1ea821a6c3 | ||
|
|
3358254212 | ||
|
|
dbde0b2719 | ||
|
|
9ead92a490 | ||
|
|
feb6f2fed6 | ||
|
|
128c442b17 | ||
|
|
162db40370 | ||
|
|
5855fd069f | ||
|
|
c045b1ca6b | ||
|
|
d1319977d6 | ||
|
|
9c073364f5 | ||
|
|
e9554447d6 | ||
|
|
f3f9d37d59 | ||
|
|
0454f3bc8f | ||
|
|
aa81bc0589 | ||
|
|
3f70ee3e54 | ||
|
|
c43149f4c9 | ||
|
|
3d4252f43c |
19
.devcontainer/Dockerfile
Normal file
19
.devcontainer/Dockerfile
Normal 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
9
.devcontainer/bin/copy-plugin
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
declare PLUGIN_NAME="$1"
|
||||
|
||||
make go-build-plugin copyplugin PLUGIN_NAME=$PLUGIN_NAME
|
||||
}
|
||||
|
||||
main "$@"
|
||||
18
.devcontainer/devcontainer.json
Normal file
18
.devcontainer/devcontainer.json
Normal 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"]
|
||||
}
|
||||
129
HISTORY.md
129
HISTORY.md
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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) \
|
||||
|
||||
@@ -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
6
debian/control
vendored
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
20
docker/usr/local/bin/pack
Executable 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 "$@"
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
"0.22.9",
|
||||
"0.23.9",
|
||||
"0.24.10",
|
||||
"0.25.2"
|
||||
"0.25.6"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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`.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
@@ -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"> # go to your server's IP and follow the web installer</span>
|
||||
<span class="output"> # Configure your server domain via `dokku domains:set-global`</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # 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"> # go to your server's IP and follow the web installer</span>
|
||||
<span class="output"> # Configure your server domain via `dokku domains:set-global`</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # and user access (via `dokku ssh-keys:add`) to complete the installation</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
1
plugins/20_events/git-from-archive
Symbolic link
1
plugins/20_events/git-from-archive
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/git-from-directory
Symbolic link
1
plugins/20_events/git-from-directory
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/git-from-image
Symbolic link
1
plugins/20_events/git-from-image
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core app-json plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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)"
|
||||
|
||||
|
||||
32
plugins/builder-dockerfile/core-post-extract
Executable file
32
plugins/builder-dockerfile/core-post-extract
Executable 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 "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-dockerfile plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ARG APP_IMAGE
|
||||
FROM $APP_IMAGE
|
||||
|
||||
COPY 00-global-env.sh 01-app-env.sh /app/.profile.d/
|
||||
@@ -0,0 +1,5 @@
|
||||
ARG APP_IMAGE
|
||||
FROM $APP_IMAGE
|
||||
|
||||
COPY .env.d /tmp/env
|
||||
COPY .env /app/.env
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-herokuish plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-null plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-pack plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core buildpacks plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core checks plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core common plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core config plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core cron plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -42,7 +42,7 @@ trigger-docker-options-docker-args() {
|
||||
case "$IMAGE_SOURCE_TYPE" in
|
||||
dockerfile)
|
||||
case "$line" in
|
||||
--link* | -v*)
|
||||
--link* | -v* | --volume*)
|
||||
continue
|
||||
;;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core docker-options plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core domains plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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
57
plugins/git/git-from-archive
Executable 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
32
plugins/git/git-from-image
Executable 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 "$@"
|
||||
@@ -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() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core git plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core logs plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core network plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core nginx-vhosts plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core plugin plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core proxy plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core ps plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core registry plugin"
|
||||
version = "0.24.0"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core repo plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core resource plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core run plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
48
plugins/scheduler-docker-local/bin/scheduler-deploy-process
Executable file
48
plugins/scheduler-docker-local/bin/scheduler-deploy-process
Executable 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 "$@"
|
||||
116
plugins/scheduler-docker-local/bin/scheduler-deploy-process-container
Executable file
116
plugins/scheduler-docker-local/bin/scheduler-deploy-process-container
Executable 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 "$@"
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 "$@"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core scheduler-docker-local plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core scheduler-null plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core shell plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core ssh-keys plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
27
plugins/storage/bin/chown-storage-dir
Executable file
27
plugins/storage/bin/chown-storage-dir
Executable 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 "$@"
|
||||
@@ -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
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core storage plugin"
|
||||
version = "0.25.2"
|
||||
version = "0.25.6"
|
||||
[plugin.config]
|
||||
|
||||
6
plugins/storage/subcommands/ensure-directory
Executable file
6
plugins/storage/subcommands/ensure-directory
Executable 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 "$@"
|
||||
@@ -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
Reference in New Issue
Block a user