Compare commits
373 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4662ac2774 | ||
|
|
dd4d66fcb6 | ||
|
|
3ab23dde07 | ||
|
|
18a6ba90f9 | ||
|
|
a901661e91 | ||
|
|
9781a905a7 | ||
|
|
4cd064f76c | ||
|
|
f9be3dd974 | ||
|
|
4e50214b80 | ||
|
|
5c27ec31b7 | ||
|
|
b061843eb1 | ||
|
|
76d9b37b22 | ||
|
|
dff21e1d36 | ||
|
|
888f45254a | ||
|
|
ebcacdb5af | ||
|
|
5a002f9007 | ||
|
|
8d11789566 | ||
|
|
b0677fefa7 | ||
|
|
76d36f0758 | ||
|
|
5ae531ca25 | ||
|
|
5debadfde1 | ||
|
|
642dc83702 | ||
|
|
99bc51f106 | ||
|
|
c05f220d14 | ||
|
|
741ea68cac | ||
|
|
58dca68fb4 | ||
|
|
b1db1e3e6f | ||
|
|
e4c7e3eb74 | ||
|
|
0c9a98ce18 | ||
|
|
30d71d4a0e | ||
|
|
239391540f | ||
|
|
8f37b0f409 | ||
|
|
13d69a13f1 | ||
|
|
f734fb34f8 | ||
|
|
f186f6cc79 | ||
|
|
16f0a0dcfb | ||
|
|
a6729a562b | ||
|
|
b875def7de | ||
|
|
828ba13eec | ||
|
|
9bec66d5d6 | ||
|
|
30e09b8a07 | ||
|
|
5c1a1baf08 | ||
|
|
ade2cc8a7c | ||
|
|
0a31f6fe3a | ||
|
|
54f9fcf856 | ||
|
|
720d37dc5d | ||
|
|
5804cd11bc | ||
|
|
3254c52d7c | ||
|
|
090e243438 | ||
|
|
d697004889 | ||
|
|
2392c69a28 | ||
|
|
6ea57dafe7 | ||
|
|
8c34cfe64e | ||
|
|
1ec71cd509 | ||
|
|
43b9d9d4b6 | ||
|
|
6462dd891c | ||
|
|
353438dbd3 | ||
|
|
a9821decca | ||
|
|
548ca90e57 | ||
|
|
d55e34a55f | ||
|
|
d09a7506df | ||
|
|
ccdbaa84f9 | ||
|
|
7aa1334af9 | ||
|
|
66e66c9d18 | ||
|
|
57fe5f472f | ||
|
|
5612b0e7d2 | ||
|
|
52a88d63ad | ||
|
|
f98e7702fb | ||
|
|
7a710005a1 | ||
|
|
4d13e0c2f6 | ||
|
|
ffcf2215de | ||
|
|
70576f9ca7 | ||
|
|
8e954d99df | ||
|
|
5c1a6a68af | ||
|
|
aea8581b09 | ||
|
|
3511ae53f4 | ||
|
|
335143fca3 | ||
|
|
75b7ae94e1 | ||
|
|
c4270ca950 | ||
|
|
8a4b0e16e4 | ||
|
|
ebe7c82fb9 | ||
|
|
fbdf77ab38 | ||
|
|
9352e7a594 | ||
|
|
28de1b3fba | ||
|
|
64b1a54cad | ||
|
|
3c47971c61 | ||
|
|
6b90dc70b1 | ||
|
|
859ea13b0a | ||
|
|
51a3b0312a | ||
|
|
1d5699a67f | ||
|
|
eb7fde9c12 | ||
|
|
c8b86508eb | ||
|
|
61503b7b17 | ||
|
|
f918efa8f9 | ||
|
|
dba2246d7a | ||
|
|
d09cfb82f8 | ||
|
|
d02efdcc05 | ||
|
|
06bdee37ff | ||
|
|
e4c0c6b9d9 | ||
|
|
72c5172873 | ||
|
|
36e02c74fd | ||
|
|
3ae9feba8f | ||
|
|
757a829137 | ||
|
|
f7e218637e | ||
|
|
04a96125cc | ||
|
|
5141360b48 | ||
|
|
dbe80de925 | ||
|
|
4de1937e41 | ||
|
|
d4a634d24e | ||
|
|
2480b773a1 | ||
|
|
7f0b43c18f | ||
|
|
68efb73be6 | ||
|
|
2b76903bf3 | ||
|
|
6a4a94e236 | ||
|
|
9139c81db9 | ||
|
|
14249de8e5 | ||
|
|
b4db0c1a6c | ||
|
|
cd97ac3388 | ||
|
|
73f3ce7579 | ||
|
|
da67ebed5d | ||
|
|
36c2266196 | ||
|
|
6b357fdcb4 | ||
|
|
2ed3c6c356 | ||
|
|
528bd744e0 | ||
|
|
4ab42e846d | ||
|
|
d2cbb02342 | ||
|
|
e2e18cc0fc | ||
|
|
a31a7a231c | ||
|
|
669259eace | ||
|
|
45c543adde | ||
|
|
627a6bf8a5 | ||
|
|
f5e55540e9 | ||
|
|
d7f3a2b003 | ||
|
|
9ce309bed9 | ||
|
|
b62264c275 | ||
|
|
d4e832c27b | ||
|
|
59c45ea1d6 | ||
|
|
f64a754211 | ||
|
|
d8895bb64b | ||
|
|
882889a962 | ||
|
|
7338a77285 | ||
|
|
af014750aa | ||
|
|
02a8409114 | ||
|
|
3681c17aa2 | ||
|
|
f56023bb74 | ||
|
|
5ef41861d3 | ||
|
|
a679e80187 | ||
|
|
85c841da88 | ||
|
|
7cabb4dd9a | ||
|
|
286be7f3df | ||
|
|
1e915968b5 | ||
|
|
3dfb84048c | ||
|
|
78a3570bb2 | ||
|
|
9733bf9fa1 | ||
|
|
effaa8e81c | ||
|
|
7558a9898e | ||
|
|
eca6cde934 | ||
|
|
197f0c7c95 | ||
|
|
ef2682945c | ||
|
|
5e7ea4217f | ||
|
|
123fbea7c0 | ||
|
|
0673fdff2d | ||
|
|
e07befb93c | ||
|
|
8e1f890322 | ||
|
|
8ca713f6bb | ||
|
|
da1ddee0ba | ||
|
|
d48cf24c4d | ||
|
|
5614475521 | ||
|
|
b826770687 | ||
|
|
34807028db | ||
|
|
0405b36ab4 | ||
|
|
291f59999c | ||
|
|
1568fc7827 | ||
|
|
681fd6abf6 | ||
|
|
031159c1b9 | ||
|
|
812e34c6f5 | ||
|
|
5921692f83 | ||
|
|
33d5dd44d9 | ||
|
|
d7562d36e6 | ||
|
|
49a2f8ab82 | ||
|
|
82afae6447 | ||
|
|
25ab915883 | ||
|
|
0963c403ab | ||
|
|
9c1852fcdb | ||
|
|
a6aef82236 | ||
|
|
8b4e31bb22 | ||
|
|
7c923a0fa1 | ||
|
|
169f202994 | ||
|
|
4448e60a8b | ||
|
|
c744c25d35 | ||
|
|
f9ebdae66d | ||
|
|
767ba96186 | ||
|
|
55213e1045 | ||
|
|
1843d42e0b | ||
|
|
065f5e5922 | ||
|
|
f7beb3d95d | ||
|
|
c09dfb8ec8 | ||
|
|
87b90e96b6 | ||
|
|
e556be1a0d | ||
|
|
88fddf2a6d | ||
|
|
97fe71a829 | ||
|
|
988cdbd6bb | ||
|
|
be84325de1 | ||
|
|
e7d9d6b19e | ||
|
|
bd378e8a44 | ||
|
|
82da43cfba | ||
|
|
a96ad0c10c | ||
|
|
670e679a09 | ||
|
|
b03485a85b | ||
|
|
aac0408f76 | ||
|
|
5b9ed4f373 | ||
|
|
033b0952dd | ||
|
|
12e2686e3f | ||
|
|
cc2f054e6a | ||
|
|
a799630fac | ||
|
|
77f0f55ee7 | ||
|
|
48428ed777 | ||
|
|
0c7afb26b0 | ||
|
|
4f2c968daa | ||
|
|
411f0550e0 | ||
|
|
f9fcad257e | ||
|
|
b0d699f281 | ||
|
|
4e8242fe5e | ||
|
|
5ceccbdf68 | ||
|
|
324c08a8a2 | ||
|
|
103e47b6dd | ||
|
|
09831c3b93 | ||
|
|
99336870b8 | ||
|
|
c81e980fcf | ||
|
|
dbdf2ad55d | ||
|
|
9306011f70 | ||
|
|
162abcee4f | ||
|
|
c1ff3d4652 | ||
|
|
f9693e78c8 | ||
|
|
fe549f2fb5 | ||
|
|
d9300ad210 | ||
|
|
8ddf4888db | ||
|
|
bf5fbf4412 | ||
|
|
dfc98ecc0f | ||
|
|
86e53f96a9 | ||
|
|
3d4205b206 | ||
|
|
f81c802ecc | ||
|
|
5d9157bc40 | ||
|
|
6a85d6a58b | ||
|
|
8ddb214b0e | ||
|
|
308927adce | ||
|
|
7caa95b3f3 | ||
|
|
b5c85ad5be | ||
|
|
bad90b2b1d | ||
|
|
4c74e0dfba | ||
|
|
46933051b9 | ||
|
|
aeb9241d3b | ||
|
|
0d9b6b9852 | ||
|
|
5cac43fe55 | ||
|
|
8cc92680c5 | ||
|
|
b583f80221 | ||
|
|
6ab9f28d77 | ||
|
|
67c8af3869 | ||
|
|
12a9bdbf6e | ||
|
|
8c3fd77cfd | ||
|
|
9137be814c | ||
|
|
aad7f67f7c | ||
|
|
815b839eeb | ||
|
|
608f9d0333 | ||
|
|
ccbe2c719a | ||
|
|
76b36aa3f6 | ||
|
|
8c81d520f6 | ||
|
|
afe1e8b33c | ||
|
|
6eb0bd8c87 | ||
|
|
f3d53fbba4 | ||
|
|
b7ff627368 | ||
|
|
9ffddf3561 | ||
|
|
56ff76584d | ||
|
|
324d98d231 | ||
|
|
277e9691e1 | ||
|
|
bce0671057 | ||
|
|
ff10ef2c26 | ||
|
|
1d8a98e5ce | ||
|
|
cb43d0cc64 | ||
|
|
065bba5851 | ||
|
|
8efac2923b | ||
|
|
fc8c58a1e6 | ||
|
|
20b2773ea2 | ||
|
|
0bd7613da4 | ||
|
|
f7ef14d737 | ||
|
|
e00e498e50 | ||
|
|
17fb2ace91 | ||
|
|
2deb575961 | ||
|
|
a7465f9d81 | ||
|
|
9d55e37687 | ||
|
|
3c5a3fdd7c | ||
|
|
4477c92df9 | ||
|
|
a6062d4ab4 | ||
|
|
41f24a58b1 | ||
|
|
352900fcff | ||
|
|
62424633fc | ||
|
|
e2184a6f12 | ||
|
|
755cd909ed | ||
|
|
6338b368d4 | ||
|
|
ca56fa1b8b | ||
|
|
7c818eda47 | ||
|
|
bdb160bec1 | ||
|
|
25b90d62d2 | ||
|
|
7cd6f7666c | ||
|
|
2cdfa1cae1 | ||
|
|
17d2866153 | ||
|
|
d459b4171d | ||
|
|
e4ec973a6e | ||
|
|
3df9a5629f | ||
|
|
02b98e4736 | ||
|
|
f45b5bfd5e | ||
|
|
e39a5663bf | ||
|
|
89cc896c27 | ||
|
|
be95a619bc | ||
|
|
cafbf44e2f | ||
|
|
e64b69248a | ||
|
|
441ac29c7c | ||
|
|
ed84f21c08 | ||
|
|
5884576fc2 | ||
|
|
922b6e3722 | ||
|
|
cca507da6a | ||
|
|
d58fe853d6 | ||
|
|
03dc90b4fd | ||
|
|
2a4918c7ce | ||
|
|
7bb130edb7 | ||
|
|
3af1342a9b | ||
|
|
d16ff7fa12 | ||
|
|
d5dbd456ea | ||
|
|
3f25514e1a | ||
|
|
e3d0f693a7 | ||
|
|
97b33a9138 | ||
|
|
f73c927512 | ||
|
|
97750f8b28 | ||
|
|
827dbbc740 | ||
|
|
89e92749a6 | ||
|
|
e877a996be | ||
|
|
6bfbe0bb66 | ||
|
|
d728237697 | ||
|
|
279a706f78 | ||
|
|
dbd48356f5 | ||
|
|
6dc55624bd | ||
|
|
5e645e1489 | ||
|
|
87a786fec5 | ||
|
|
c9fc203596 | ||
|
|
f87525d8cf | ||
|
|
df4dbe5d88 | ||
|
|
31332a5061 | ||
|
|
1a66102e30 | ||
|
|
8c0380beec | ||
|
|
a7ef06028e | ||
|
|
c80fcf7b8e | ||
|
|
db5630eb32 | ||
|
|
1dc63eecbd | ||
|
|
530066875d | ||
|
|
59aef9a408 | ||
|
|
7b51bcd4ac | ||
|
|
80b782e6ed | ||
|
|
c179958afc | ||
|
|
a3ab4d1b68 | ||
|
|
575ae84e68 | ||
|
|
102c3b3007 | ||
|
|
18f3b940c3 | ||
|
|
baa15d7437 | ||
|
|
9804d42e67 | ||
|
|
0c182415a7 | ||
|
|
1599120c3e | ||
|
|
a53b5953ea | ||
|
|
0d7c4cd036 | ||
|
|
e42e26e16b | ||
|
|
b35a89c5a9 | ||
|
|
a1f4a9a386 | ||
|
|
12531dfb3e | ||
|
|
7115839fd5 |
@@ -1,116 +1,14 @@
|
||||
---
|
||||
version: 2.1
|
||||
|
||||
commands:
|
||||
init-tests:
|
||||
description: "Setup dokku for testing"
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /home/circleci/project
|
||||
- run:
|
||||
name: resolve dokku.me
|
||||
command: |
|
||||
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to ens4
|
||||
# this is maybe eth0 on github
|
||||
ifconfig
|
||||
sudo ip addr add 10.0.0.2/24 broadcast 10.0.0.255 dev ens4
|
||||
- run:
|
||||
name: install ci-dependencies
|
||||
command: make ci-dependencies
|
||||
- run:
|
||||
name: setup tests
|
||||
command: ./tests/ci/setup.sh
|
||||
- run:
|
||||
name: dokku cleanup:skip
|
||||
command: echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup
|
||||
- run:
|
||||
name: dokku report
|
||||
command: dokku report
|
||||
|
||||
executors:
|
||||
default:
|
||||
machine:
|
||||
image: ubuntu-1604:201903-01
|
||||
working_directory: /home/circleci/project
|
||||
|
||||
jobs:
|
||||
build:
|
||||
executor: default
|
||||
noop:
|
||||
docker:
|
||||
- image: cimg/base:2020.01
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: build package
|
||||
command: ./tests/ci/setup.sh build
|
||||
- persist_to_workspace:
|
||||
root: /home/circleci/project
|
||||
paths:
|
||||
- build
|
||||
- store_artifacts:
|
||||
path: /home/circleci/project/build/dokku.deb
|
||||
- store_artifacts:
|
||||
path: /home/circleci/project/build/dokku.rpm
|
||||
docker-deploy-tests:
|
||||
executor: default
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run docker deploy tests
|
||||
shell: /bin/bash
|
||||
no_output_timeout: 20
|
||||
command: |
|
||||
./tests/ci/setup.sh docker
|
||||
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
||||
go-tests:
|
||||
executor: default
|
||||
parallelism: 4
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run go tests
|
||||
command: |
|
||||
case $CIRCLE_NODE_INDEX in
|
||||
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
||||
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
||||
2) sudo -E make -e deploy-test-multi ;;
|
||||
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||
esac
|
||||
- store_artifacts:
|
||||
path: ./coverage.out
|
||||
test:
|
||||
executor: default
|
||||
parallelism: 4
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run bats tests
|
||||
command: |
|
||||
if ! sudo -E make -e test-ci; then
|
||||
sudo -E make tests-ci-retry-failed
|
||||
fi
|
||||
no_output_timeout: 60m
|
||||
shell: /bin/bash
|
||||
- run:
|
||||
name: output oomkills
|
||||
command: cat /var/log/syslog
|
||||
when: on_fail
|
||||
- store_artifacts:
|
||||
path: ./test-results
|
||||
destination: test-results
|
||||
- store_test_results:
|
||||
path: test-results
|
||||
- run: echo "this is a noop"
|
||||
|
||||
workflows:
|
||||
workflow:
|
||||
noop:
|
||||
jobs:
|
||||
- build
|
||||
- docker-deploy-tests:
|
||||
requires:
|
||||
- build
|
||||
- test
|
||||
- go-tests:
|
||||
requires:
|
||||
- build
|
||||
- test:
|
||||
requires:
|
||||
- build
|
||||
- go-tests
|
||||
- noop
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- vendor/**/*
|
||||
- tests/**/*
|
||||
- "**_test.go"
|
||||
- contrib/*
|
||||
- vendor/**/*
|
||||
- tests/**/*
|
||||
- "**_test.go"
|
||||
- contrib/*
|
||||
|
||||
51
.github/commands/bump-azure
vendored
Executable file
51
.github/commands/bump-azure
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
main() {
|
||||
declare VERSION="$1" BOT_GITHUB_USERNAME="$2" BOT_GITHUB_API_TOKEN="$3"
|
||||
local GH_VERSION=1.6.1
|
||||
local DATE_UPDATED="$(date +"%Y-%m-%d")"
|
||||
local GH_FOLDER="gh_${GH_VERSION}_linux_amd64"
|
||||
|
||||
echo "=====> Downloading gh"
|
||||
wget -O gh.tar.gz "https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_FOLDER}.tar.gz"
|
||||
mkdir -p tmp
|
||||
tar xzf gh.tar.gz -C tmp
|
||||
if [[ ! -f tmp/$GH_FOLDER/bin/gh ]]; then
|
||||
echo "Failed to extract gh"
|
||||
return 1
|
||||
fi
|
||||
|
||||
cd tmp
|
||||
|
||||
$GH_FOLDER/bin/gh auth login --with-token <<<"$BOT_GITHUB_API_TOKEN"
|
||||
|
||||
echo "=====> Cloning quickstart templates"
|
||||
rm -rf azure-quickstart-templates >/dev/null
|
||||
git clone https://github.com/Azure/azure-quickstart-templates.git azure-quickstart-templates
|
||||
|
||||
pushd azure-quickstart-templates >/dev/null
|
||||
|
||||
echo "=====> Updating values"
|
||||
contents="$(jq '.githubUsername = "dokku"' dokku-vm/metadata.json)"
|
||||
echo "${contents}" >dokku-vm/metadata.json
|
||||
contents="$(jq --arg DATE_UPDATED "$DATE_UPDATED" '.dateUpdated = $DATE_UPDATED' dokku-vm/metadata.json)"
|
||||
echo "${contents}" >dokku-vm/metadata.json
|
||||
|
||||
contents="$(jq --arg VERSION "$VERSION" '.parameters.dokkuVersion.defaultValue = $VERSION' dokku-vm/azuredeploy.json)"
|
||||
echo "${contents}" >dokku-vm/azuredeploy.json
|
||||
|
||||
echo "=====> Updating remote repository"
|
||||
git add dokku-vm
|
||||
git checkout -b dokku-$VERSION
|
||||
git commit -m "Update dokku-vm dokku version to $VERSION"
|
||||
git remote set-url origin "https://$BOT_GITHUB_USERNAME:$BOT_GITHUB_API_TOKEN@github.com/dokku/azure-quickstart-templates.git"
|
||||
git push -f origin dokku-$VERSION
|
||||
|
||||
echo "=====> Creating upstream pull request"
|
||||
../$GH_FOLDER/bin/gh pr create --head dokku:dokku-$VERSION --repo Azure/azure-quickstart-templates --title "Update dokku-vm dokku version to $VERSION" --body ''
|
||||
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
main "$@"
|
||||
15
.github/commands/ci-run
vendored
Executable file
15
.github/commands/ci-run
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
main() {
|
||||
declare FILE_NAME="$1"
|
||||
|
||||
mkdir -p test-results/bats
|
||||
pushd tests/unit >/dev/null
|
||||
bats --report-formatter junit --output ../../test-results/bats "$FILE_NAME.bats"
|
||||
popd &>/dev/null
|
||||
|
||||
ls -lah test-results/bats
|
||||
}
|
||||
|
||||
main "$@"
|
||||
28
.github/commands/ci-setup
vendored
Executable file
28
.github/commands/ci-setup
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
echo "=====> set hostname"
|
||||
hostname
|
||||
internal_ip="$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')"
|
||||
sudo hostname "dokku.me"
|
||||
echo "dokku.me" | sudo tee /etc/hostname
|
||||
hostname
|
||||
sudo cat /etc/hostname
|
||||
|
||||
echo "=====> resolve dokku.me"
|
||||
sudo apt -qq -y --no-install-recommends install net-tools
|
||||
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0
|
||||
ifconfig
|
||||
sudo ip addr add 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
|
||||
|
||||
echo "=====> install ci-dependencies"
|
||||
make ci-dependencies
|
||||
|
||||
echo "=====> setup tests"
|
||||
./tests/ci/setup.sh
|
||||
|
||||
echo "=====> dokku cleanup:skip"
|
||||
echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup
|
||||
|
||||
echo "=====> dokku report"
|
||||
dokku report
|
||||
9
.github/commands/matrix
vendored
Executable file
9
.github/commands/matrix
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
import json
|
||||
import os
|
||||
|
||||
keys = ["index"]
|
||||
values = [[s.replace(".bats", "") for s in os.listdir("tests/unit/") if s.endswith(".bats")]]
|
||||
zi = zip(keys, values)
|
||||
data = json.dumps(dict(zi))
|
||||
print(data.replace(" ", ""))
|
||||
10
.github/linters/.markdown-lint.yml
vendored
Normal file
10
.github/linters/.markdown-lint.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
default: true
|
||||
|
||||
# Line length
|
||||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013
|
||||
MD013: false
|
||||
|
||||
# Inline HTML
|
||||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md033
|
||||
MD033: false
|
||||
5
.github/linters/.yamllint.yml
vendored
Normal file
5
.github/linters/.yamllint.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length: disable
|
||||
23
.github/workflows/bump-formula.yml
vendored
23
.github/workflows/bump-formula.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: bump-formula
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
bump-formula:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Bump Brew
|
||||
env:
|
||||
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
brew tap dokku/repo "https://$HOMEBREW_GITHUB_USERNAME:$HOMEBREW_GITHUB_API_TOKEN@github.com/dokku/homebrew-repo.git"
|
||||
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku
|
||||
162
.github/workflows/ci.yml
vendored
Normal file
162
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
---
|
||||
name: CI
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-16.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: build package
|
||||
run: ./tests/ci/setup.sh build
|
||||
|
||||
- name: set matrix for build
|
||||
id: set-matrix
|
||||
run: |
|
||||
json=$(python .github/commands/matrix)
|
||||
echo $json
|
||||
echo "::set-output name=matrix::$(echo "$json")"
|
||||
|
||||
- name: upload packages
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: build
|
||||
|
||||
unit-tests:
|
||||
name: unit.${{ matrix.index }}
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.build.outputs.matrix)}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
# - name: start ssh session
|
||||
# uses: luchihoratiu/debug-via-ssh@main
|
||||
# with:
|
||||
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
||||
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
||||
|
||||
- name: run ci
|
||||
timeout-minutes: 30
|
||||
run: sudo -E ./.github/commands/ci-run ${{ matrix.index }}
|
||||
env:
|
||||
SYNC_GITHUB_PASSWORD: ${{ secrets.SYNC_GITHUB_PASSWORD }}
|
||||
SYNC_GITHUB_USERNAME: ${{ secrets.SYNC_GITHUB_USERNAME }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-results-${{ matrix.index }}
|
||||
path: test-results
|
||||
|
||||
docker-deploy-tests:
|
||||
name: docker
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
- name: test docker deploys
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
./tests/ci/setup.sh docker
|
||||
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
||||
|
||||
go-tests:
|
||||
name: go.${{ matrix.index }}
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
index: [0, 1, 2, 3]
|
||||
env:
|
||||
GITHUB_NODE_INDEX: ${{ matrix.index }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
- name: run go tests
|
||||
run: |
|
||||
export CIRCLE_SHA1=$GITHUB_SHA
|
||||
echo "CODACY_TOKEN=$CODACY_TOKEN"
|
||||
if [ "$CODACY_TOKEN" != "" ]; then
|
||||
echo "Detected value for CODACY_TOKEN"
|
||||
fi
|
||||
case $GITHUB_NODE_INDEX in
|
||||
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
||||
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
||||
2) sudo -E make -e deploy-test-multi ;;
|
||||
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||
esac
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: coverage.${{ matrix.index }}
|
||||
path: test-results/coverage
|
||||
|
||||
publish-test-results:
|
||||
name: publish-test-results
|
||||
needs: unit-tests
|
||||
runs-on: ubuntu-16.04
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
- name: download test-results
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: test-results
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
|
||||
with:
|
||||
check_name: Unit Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: test-results/**/*.xml
|
||||
comment_on_pr: false
|
||||
58
.github/workflows/codeql-analysis.yml
vendored
58
.github/workflows/codeql-analysis.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
@@ -12,12 +13,13 @@
|
||||
|
||||
name: "CodeQL"
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '18 22 * * 2'
|
||||
|
||||
@@ -29,40 +31,40 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
language: ['go']
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
# - run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
74
.github/workflows/lint.yml
vendored
Normal file
74
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
name: 'lint'
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
name: hadolint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run hadolint
|
||||
uses: brpaz/hadolint-action@1623ba61710b974b55ba455930e6f2c8ef919778
|
||||
# v1.3.1 => 1623ba61710b974b55ba455930e6f2c8ef919778
|
||||
|
||||
markdown-lint:
|
||||
name: markdown-lint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run markdown-lint
|
||||
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb
|
||||
# v1.5.0 => 04d43ee9191307b50935a753da3b775ab695eceb
|
||||
with:
|
||||
config: '.github/linters/.markdown-lint.yml'
|
||||
args: './README.md'
|
||||
|
||||
shellcheck:
|
||||
name: shellcheck
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run shellcheck
|
||||
uses: ludeeus/action-shellcheck@d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||
# 1.0.0 => d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||
env:
|
||||
# keep in sync with tests/shellcheck-exclude
|
||||
SHELLCHECK_OPTS: -e SC1001 -e SC1003 -e SC1090 -e SC1091 -e SC1117 -e SC2029 -e SC2034 -e SC2046 -e SC2064 -e SC2068 -e SC2086 -e SC2119 -e SC2120 -e SC2128 -e SC2148 -e SC2153 -e SC2154 -e SC2155 -e SC2162 -e SC2174 -e SC2179 -e SC2191 -e SC2199 -e SC2207 -e SC2219 -e SC2220 -e SC2230 -e SC2231 -e SC2235
|
||||
|
||||
shfmt:
|
||||
name: shfmt
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run shfmt
|
||||
uses: luizm/action-sh-checker@442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||
# v0.1.12 => 442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||
env:
|
||||
SHFMT_OPTS: -l -bn -ci -i 2 -d
|
||||
with:
|
||||
sh_checker_shellcheck_disable: true
|
||||
|
||||
yamllint:
|
||||
name: yamllint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run yamllint
|
||||
uses: ibiqlik/action-yamllint@b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||
# v3.0.0 => b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||
with:
|
||||
config_file: '.github/linters/.yamllint.yml'
|
||||
87
.github/workflows/release.yml
vendored
Normal file
87
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
name: 'release'
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_type:
|
||||
description: 'Release type [build, betafish, patch, minor, major]'
|
||||
required: true
|
||||
default: 'build'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: release
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: install package_cloud
|
||||
run: gem install package_cloud
|
||||
|
||||
- name: configure git
|
||||
run: |
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
|
||||
- name: build package
|
||||
run: contrib/release-dokku ${{ github.event.inputs.release_type }}
|
||||
|
||||
- name: output version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(cat build/next-version)"
|
||||
|
||||
- name: upload packages
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: build
|
||||
|
||||
bump-azure:
|
||||
name: bump-azure
|
||||
runs-on: ubuntu-20.04
|
||||
needs: release
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Bump Azure Template
|
||||
env:
|
||||
BOT_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||
BOT_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
VERSION=${{ needs.release.outputs.version }}
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
.github/commands/bump-azure "${VERSION:1}" "$BOT_GITHUB_USERNAME" "$BOT_GITHUB_API_TOKEN"
|
||||
|
||||
bump-formula:
|
||||
name: bump-formula
|
||||
runs-on: macos-latest
|
||||
needs: release
|
||||
steps:
|
||||
- name: Bump Homebrew Formula
|
||||
env:
|
||||
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
brew tap dokku/repo "https://$HOMEBREW_GITHUB_USERNAME:$HOMEBREW_GITHUB_API_TOKEN@github.com/dokku/homebrew-repo.git"
|
||||
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ needs.release.outputs.version }}.tar.gz" dokku/repo/dokku
|
||||
@@ -5,10 +5,10 @@ several ways to help out:
|
||||
|
||||
* Create an [issue](https://github.com/dokku/dokku/issues) on GitHub, if you
|
||||
have found a bug
|
||||
* Write test cases for open bug issues
|
||||
* Write [test cases](https://dokku.com/docs/development/testing/) for open bug issues
|
||||
* Write patches for open bug/feature issues, preferably with test cases
|
||||
included
|
||||
* Contribute to the [documentation](http://dokku.viewdocs.io/dokku/)
|
||||
* Contribute to the [documentation](https://dokku.com/docs/)
|
||||
* Come up with new ways, non-commercial to show off our [lovely logo](https://avatars1.githubusercontent.com/u/13455795)
|
||||
* Blog about different ways you are using dokku
|
||||
* Sponsor the Dokku project financially on [OpenCollective](https://opencollective.com/dokku#support) or [Patreon](https://www.patreon.com/dokku)
|
||||
@@ -25,7 +25,7 @@ a chance of keeping on top of things.
|
||||
* [Which branch to base the work](#which-branch-to-base-the-work)
|
||||
* [Submitting Changes](#submitting-changes)
|
||||
* [When will my change be merged?](#when-will-my-change-be-merged)
|
||||
* [Test cases and codesniffs](#test-cases-and-codesniffs)
|
||||
* [Running tests locally](#running-tests-locally)
|
||||
* [Additional Resources](#additional-resources)
|
||||
|
||||
## Reporting security issues
|
||||
@@ -45,7 +45,7 @@ encounter an issue. We always appreciate a well-written, thorough bug report,
|
||||
and will thank you for it!
|
||||
|
||||
Sometimes Dokku is missing a feature you need. In some cases, those features can
|
||||
be found in pre-existing [plugins](http://dokku.viewdocs.io/dokku/plugins/),
|
||||
be found in pre-existing [plugins](https://dokku.com/docs/plugins/),
|
||||
and we encourage our users to create and contribute such packages. From time to
|
||||
time, we will also pull plugins into the Dokku core when the task they solve is
|
||||
a common one for our users.
|
||||
@@ -127,21 +127,10 @@ requests:
|
||||
- backwards incompatible change (minor)
|
||||
- major feature (minor)
|
||||
|
||||
### Test cases and codesniffs
|
||||
### Running tests locally
|
||||
|
||||
Dokku tests require [bats](https://github.com/sstephenson/bats).
|
||||
To run the test cases locally use the following command:
|
||||
|
||||
make ci-dependencies
|
||||
make unit-tests deploy-tests
|
||||
|
||||
To run the shellcheck sniffs for Dokku coding standards:
|
||||
|
||||
make ci-dependencies
|
||||
make lint
|
||||
|
||||
The [testing docs](http://dokku.viewdocs.io/dokku/development/testing/)
|
||||
contains installation info for bats and shellcheck.
|
||||
Please read the [testing docs](https://dokku.com/docs/development/testing/),
|
||||
which contains test setup information as well as tips for running tests.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ RUN addgroup --gid $DOKKU_GID dokku \
|
||||
|
||||
COPY ./tests/dhparam.pem /tmp/dhparam.pem
|
||||
COPY ./build/dokku.deb /tmp/dokku.deb
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
# hadolint ignore=DL3005,DL3008
|
||||
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
|
||||
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
|
||||
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
|
||||
@@ -25,8 +28,8 @@ RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections
|
||||
&& cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \
|
||||
&& apt-get update -qq \
|
||||
&& apt-get upgrade -qq -y \
|
||||
&& apt-get install --no-install-recommends --only-upgrade -qq -y openssl openssh-server \
|
||||
&& apt install --no-install-recommends -qq -y rsync /tmp/dokku.deb \
|
||||
&& apt-get -qq -y --no-install-recommends --only-upgrade install openssl openssh-server \
|
||||
&& apt-get -qq -y --no-install-recommends install rsync /tmp/dokku.deb \
|
||||
&& apt-get purge -qq -y syslog-ng-core \
|
||||
&& apt-get autoremove -qq -y \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
411
HISTORY.md
411
HISTORY.md
@@ -1,5 +1,396 @@
|
||||
# History
|
||||
|
||||
## 0.24.2
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.24.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.24.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4473: @josegonzalez Add the correct log mount for app logs
|
||||
|
||||
### Other
|
||||
|
||||
- #4465: @Akirtovskis Add git:unlock command
|
||||
- #4470: @dependabot-preview[bot] chore(deps): bump socket.io from 3.1.2 to 4.0.0 in /tests/apps/.websocket.disabled
|
||||
- #4462: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 189 to 190 in /tests/apps/php
|
||||
|
||||
## 0.24.1
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.24.1/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.24.1 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4454: @josegonzalez Use proper title for azure releases and fix tmp dir creation
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4461: @josegonzalez Add dark mode support to documentation site
|
||||
- #4457: @Cellane Rename 0.24.0 migration guide
|
||||
- #4456: @josegonzalez Fix doc link and add 0.24.0 appendix to migration guides
|
||||
|
||||
## 0.24.0
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.24.0/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.24.0 bash bootstrap.sh
|
||||
```
|
||||
|
||||
See the [0.24.0 migration guide](/docs/appendices/0.24.0-migration-guide.md) for more information on migrating to 0.24.0.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4449: @josegonzalez Gitignore trigger symlink
|
||||
- #4447: @josegonzalez Checkout code to ensure the bump-azure script is available
|
||||
|
||||
### New Features
|
||||
|
||||
- #4453: @josegonzalez Simplify tar and zip deploys via git:from-archive
|
||||
- #4450: @josegonzalez Simplify docker image deploys via git:from-image
|
||||
- #4379: @josegonzalez Allow builders to be detected based on repository contents
|
||||
- #4425: @josegonzalez Implement heroku's postdeploy deployment task
|
||||
- #4424: @josegonzalez Implement git:auth command
|
||||
- #4419: @josegonzalez Add parallelism to certain proxy commands
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4374: @josegonzalez Change exit code when app does not exist
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4451: @josegonzalez Update links to builder documentation to avoid extra rewrite
|
||||
- #4448: @josegonzalez Add documentation for git push to dokku-in-docker
|
||||
|
||||
## 0.23.9
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.9/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.9 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4445: @josegonzalez Bump azure template and formula directly on release
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4444: @josegonzalez Uuse updated links for documentation
|
||||
- #4439: @RyukerLiu View Doc redirect not working. Change to use direct link
|
||||
|
||||
## 0.23.8
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.8/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.8 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4437: @josegonzalez Switch to using GIT_DIR environment variable to fix Centos 7 support
|
||||
- #4436: @josegonzalez Properly handle directory change when cleaning .git directory
|
||||
|
||||
### New Features
|
||||
|
||||
- #4428: @josegonzalez Bump azure ARM quickstart template on release
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4435: @josegonzalez Change page title based on current page
|
||||
- #4427: @josegonzalez Change process management doc references to make more sense
|
||||
|
||||
### Other
|
||||
|
||||
- #4438: @josegonzalez Split out nginx tests further to decrease overall CI runtime
|
||||
- #4430: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 11.0.0 to 11.0.1 in /tests/apps/java
|
||||
|
||||
## 0.23.7
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4421: @josegonzalez Keep the git directory for worktree-enabled installations
|
||||
|
||||
### New Features
|
||||
|
||||
- #4420: @josegonzalez Add ability to specify X-Forwarded-Ssl header for proxied requests
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4422: @josegonzalez Add warning regarding shallow clone pushes
|
||||
- #4417: @andrewk17 Correct vector sink example command
|
||||
- #4414: @josegonzalez Use correct html for offsite digitalocean link
|
||||
- #4413: @josegonzalez Fix SSL documentation link in troubleshooting docs
|
||||
|
||||
### Other
|
||||
|
||||
- #4423: @josegonzalez Drop unused sigil packaging code
|
||||
- #4418: @josegonzalez Drop unused skip-restart flag for proxy:disable
|
||||
|
||||
## 0.23.6
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.6/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.6 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4412: @markuspoerschke Fix generation of crontab
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4411: @ltalirz Replace nginx:build-config => proxy:build-config
|
||||
|
||||
## 0.23.5
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.5 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4406: @znz Fix typo in error message
|
||||
|
||||
### New Features
|
||||
|
||||
- #4404: @josegonzalez Add ability to trigger release via github actions
|
||||
|
||||
### Tests
|
||||
|
||||
- #4403: @josegonzalez Llint files during CI
|
||||
|
||||
## 0.23.4
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.4 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4402: @josegonzalez fix: correctly handle is-deployed check
|
||||
- #4399: @josegonzalez Drop extra log output in cron plugin
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4400: @solvethex Add tail option
|
||||
|
||||
## 0.23.3
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4397: @josegonzalez Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
|
||||
- #4394: @josegonzalez Swap order of arguments on config-get call
|
||||
|
||||
### New Features
|
||||
|
||||
- #4395: @josegonzalez Add environment variable support to CNB-based containers
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4393: @josegonzalez Use docker-image-labeler in cnb builder-build trigger
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4396: @nerg4l Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
|
||||
|
||||
### Tests
|
||||
|
||||
- #4390: @josegonzalez Run tests faster by not cloning the buildpack each time
|
||||
|
||||
### Other
|
||||
|
||||
- #4389: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
|
||||
|
||||
## 0.23.2
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4388: @josegonzalez Do not inject max-size option when not using local or json-file log-drivers
|
||||
- #4386: @josegonzalez Update to docker-image-labeler that handles in-use images
|
||||
|
||||
### New Features
|
||||
|
||||
- #4387: @josegonzalez Only warn if the vector container is stopped when fetching logs
|
||||
- #4372: @josegonzalez Add ability to clear an individual resource
|
||||
- #4384: @josegonzalez Add support for injected cron entries from external plugins
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4373: @josegonzalez Do not attempt to extract Procfile in ps:scale
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4377: @josegonzalez Add note about the dokku user cron being overwritten by Dokku
|
||||
|
||||
### Other
|
||||
|
||||
- #3757: @pickettd Add provision line to Windows Vagrant box for dokku-installer
|
||||
|
||||
## 0.23.1
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.1/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.1 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4368: @josegonzalez Always report resources
|
||||
|
||||
### New Features
|
||||
|
||||
- #4369: @josegonzalez Allow formatting :report command output as json
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4367: @josegonzalez Update deeplink to digitalocean marketplace image on homepage
|
||||
- #4366: @josegonzalez Update Digitalocean docs
|
||||
- #4363: @josegonzalez Refer to the monitored slack and github discussions channels in the issue template
|
||||
- #4359: @josegonzalez Fix command call for set-property
|
||||
- #4358: @Cellane Update header on cron documentation
|
||||
- #4357: @Cellane Fix spelling in nginx documentation
|
||||
|
||||
### Other
|
||||
|
||||
- #4365: @dependabot-preview[bot] chore(deps): bump jinja2 from 2.11.2 to 2.11.3 in /tests/apps/python-flask
|
||||
|
||||
## 0.23.0
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.0/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.0 bash bootstrap.sh
|
||||
```
|
||||
|
||||
See the [0.23.0 migration guide](/docs/appendices/0.23.0-migration-guide.md) for more information on migrating to 0.23.0.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4356: @josegonzalez Do not retag images unnecessarily
|
||||
- #4355: @josegonzalez Allow underscores in vector schemes
|
||||
- #4350: @josegonzalez Add missing trigger to events plugin
|
||||
- #4348: @josegonzalez Correct app-specific shell handling
|
||||
- #4333: @josegonzalez Drop tmpdir environment variables when not running as dokku user
|
||||
|
||||
### New Features
|
||||
|
||||
- #4336: @josegonzalez Add ability to manage stacks on an app or global level …
|
||||
- #4354: @josegonzalez Log all triggers called by golang in trace output
|
||||
- #4300: @AubreyHewes allow disabling hsts globally and explicitly enable per app
|
||||
- #4337: @josegonzalez Add logrotation to container log files
|
||||
- #4318: @josegonzalez Add ability to set client max body size via nginx:set
|
||||
- #4343: @josegonzalez feat: add initial scheduled task implementation
|
||||
- #4297: @josegonzalez Add support for cloning/syncing from a remote repository
|
||||
- #4340: @bjornpost Allow configuring x-forwarded-* proxy headers via nginx:set
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4349: @josegonzalez Remove need for internal dokku calls
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4347: @fomojola Add post-deploy webhook to list of community plugins
|
||||
- #4342: @AubreyHewes Point to current testing docs
|
||||
- #4341: @josegonzalez Add testing link to contributing.md
|
||||
|
||||
### Tests
|
||||
|
||||
- #4352: @josegonzalez Add a test for application renames
|
||||
- #4351: @josegonzalez Set hostname for CI runs
|
||||
- #4322: @josegonzalez Switch to Github Actions for CI
|
||||
|
||||
### Other
|
||||
|
||||
- #4353: @josegonzalez Drop unused flag introduced by logs max-size feature
|
||||
|
||||
## 0.22.9
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.9/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.9 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4334: @josegonzalez allow git pushes to apps that already exist but have old names
|
||||
- #4335: @josegonzalez Add error checking to plugin:install and plugin:update
|
||||
- #4338: @josegonzalez Strip trailing slashes in hostname from web installer
|
||||
- #4332: @josegonzalez Correct aws release check in release-plugin script
|
||||
- #4311: @nisseknudsen Allow named volume mounts in regex
|
||||
- #4320: @josegonzalez Hardcode cnb workdir to /workspace
|
||||
|
||||
### New Features
|
||||
|
||||
- #4321: @josegonzalez Add git version to output
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4329: @josegonzalez Standardize apt-get usage
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4323: @stianlik Fix typo in nginx documentation
|
||||
|
||||
### Tests
|
||||
|
||||
- #4331: @josegonzalez Switch to upstream bats-core
|
||||
- #4330: @josegonzalez Switch to using uuidgen for unique app names
|
||||
|
||||
### Other
|
||||
|
||||
- #4325: @WaviestBalloon Updated bootstrap.sh to not show when $DOKKU_TAG equals nothing
|
||||
- #4324: @dependabot-preview[bot] chore(deps): bump socket.io from 3.0.5 to 3.1.0 in /tests/apps/.websocket.disabled
|
||||
- #4319: @josegonzalez Update ruby dependencies in test app
|
||||
- #4312: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 187 to 188 in /tests/apps/php
|
||||
|
||||
## 0.22.8
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
@@ -2604,8 +2995,8 @@ This release is a minor bugfix to fix an issue with ssl support for spdy-enabled
|
||||
|
||||
The big-six-o. This release is largely comprised of new features that should allow for easier management of dokku. The highlights of this release are:
|
||||
|
||||
- The proxy plugin has been enhanced to allow users to map container ports to host ports. In the 0.5.0 release, we changed the semantics of how Dockerfile `EXPOSE` calls work to better follow Docker's lead, which ended up breaking how some applications were deployed to dokku. Please read our documentation surrounding [port management](http://dokku.viewdocs.io/dokku/proxy/) for more details.
|
||||
- Zero-downtime deploys can be disabled on a per-app and per-process basis. This can be used to speed up deploys when there are non-web processes being deployed, or when a user wishes to completely avoid any such waiting period. Please see the [checks documentation](http://dokku.viewdocs.io/dokku/checks-examples/) for further information.
|
||||
- The proxy plugin has been enhanced to allow users to map container ports to host ports. In the 0.5.0 release, we changed the semantics of how Dockerfile `EXPOSE` calls work to better follow Docker's lead, which ended up breaking how some applications were deployed to dokku. Please read our documentation surrounding [port management](https://dokku.com/docs/proxy/) for more details.
|
||||
- Zero-downtime deploys can be disabled on a per-app and per-process basis. This can be used to speed up deploys when there are non-web processes being deployed, or when a user wishes to completely avoid any such waiting period. Please see the [checks documentation](https://dokku.com/docs/deployment/zero-downtime-deploys/) for further information.
|
||||
|
||||
Thanks to all the contributors who helped with this release, and a special thanks to @michaelshobbs for ferrying the majority of our new functionality to it's current state!
|
||||
|
||||
@@ -2725,7 +3116,7 @@ Thanks to all the contributors who helped with this release!
|
||||
|
||||
Release 0.5.5 is mostly a documentation release, further clarifying how our default proxy implementation (nginx) interacts with Dockerfiles. Note that we also updated how ssl certificates interact with application domains, so please check out our domains and ssl documentation.
|
||||
|
||||
We've also added a small section to the [dokku homepage](http://dokku.viewdocs.io/dokku/) that lists the current core team. Feel free to look at their beautiful faces and imagine yourself contributing to Dokku and joining our core team. There are [quite a few ways to contribute](https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md) - even without code/documentation - so feel more than free to jump on the bandwagon!
|
||||
We've also added a small section to the [dokku homepage](https://dokku.com/docs/) that lists the current core team. Feel free to look at their beautiful faces and imagine yourself contributing to Dokku and joining our core team. There are [quite a few ways to contribute](https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md) - even without code/documentation - so feel more than free to jump on the bandwagon!
|
||||
|
||||
Finally, we've started an [Official Dokku Blog](https://dokku.github.io/), where we will post about dokku internals, roadmaps, potential use-cases, etc. An rss feed is available [here](https://dokku.github.io/feed.xml).
|
||||
|
||||
@@ -2824,9 +3215,9 @@ This is our largest, most feature-packed release in the history of the dokku pro
|
||||
|
||||
- Support for docker 1.10/1.11. You *must* have docker 1.9.1+ to install dokku.
|
||||
- Revamped documentation website
|
||||
- [Deployment Tasks](http://dokku.viewdocs.io/dokku/deployment/deployment-tasks/)
|
||||
- Heroku-style management of [dockerfile processes](http://dokku.viewdocs.io/dokku/deployment/dockerfiles/#procfiles-and-multiple-processes)
|
||||
- Official [persistent storage plugin](http://dokku.viewdocs.io/dokku/dokku-storage/)
|
||||
- [Deployment Tasks](https://dokku.com/docs/advanced-usage/deployment-tasks/)
|
||||
- Heroku-style management of [dockerfile processes](https://dokku.com/docs/deployment/builders/dockerfiles/#procfiles-and-multiple-processes)
|
||||
- Official [persistent storage plugin](https://dokku.com/docs/advanced-usage/persistent-storage/)
|
||||
|
||||
We'd also love it if you welcomed a few new core developers:
|
||||
|
||||
@@ -3320,9 +3711,9 @@ One new feature is colorized logging output, which should make it easier to debu
|
||||
|
||||
This is our first minor release in almost a year. Many new features and removals have occurred, so here is a neat summary:
|
||||
|
||||
- Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation/) for more details.
|
||||
- A few new official plugins have been added to the core, including [image tagging](http://dokku.viewdocs.io/dokku/application-deployment/), [certificate management](http://dokku.viewdocs.io/dokku/deployment/ssl-configuration/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details.
|
||||
- We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](http://dokku.viewdocs.io/dokku/development/plugin-triggers/) to see what is available.
|
||||
- Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](https://dokku.com/docs/development/plugin-creation/) for more details.
|
||||
- A few new official plugins have been added to the core, including [image tagging](https://dokku.com/docs/deployment/application-deployment/), [certificate management](https://dokku.com/docs/configuration/ssl/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details.
|
||||
- We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](https://dokku.com/docs/development/plugin-triggers/) to see what is available.
|
||||
- [Official datastorage plugins](https://github.com/dokku) have been created for the most commonly used datastores. If you previously used/maintained a community contributed plugin, please check these out. We'll be adding more official plugins as time goes on.
|
||||
|
||||
Thanks to the *many* contributors for making this release our best release so far, and special thanks to both @michaelshobbs and @Flink for pushing along the `0.4.0` release!
|
||||
@@ -3431,7 +3822,7 @@ This release is a bugfix release covering dokku packaging.
|
||||
|
||||
## 0.3.23
|
||||
|
||||
This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](http://dokku.viewdocs.io/dokku/). Thanks to all of our contributors for making this a great release!
|
||||
This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](https://dokku.com/docs/). Thanks to all of our contributors for making this a great release!
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
>
|
||||
> If you'd like to sponsor specific functionality, see the project's [Sponsoring](https://github.com/dokku/.github/blob/master/SPONSORING.md) document.
|
||||
>
|
||||
> If you need help figuring out how to use a specific buildpack, or are having issues using multiple buildpacks, please see our [irc or slack channels](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#the-irc-and-slack-channels). Issues pertaining to buildpacks may be closed and locked.
|
||||
> If you need help figuring out how to use a specific buildpack, are seeing an issue in during the buildpack process, or are having issues using multiple buildpacks, please see our [slack channels or github discussion board](https://dokku.com/docs/getting-started/where-to-get-help/#monitored-locations). Issues pertaining to buildpacks may be closed and locked.
|
||||
>
|
||||
> If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version.
|
||||
|
||||
|
||||
44
Makefile
44
Makefile
@@ -1,14 +1,18 @@
|
||||
DOKKU_VERSION ?= master
|
||||
|
||||
HEROKUISH_VERSION ?= 0.5.19
|
||||
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
|
||||
HEROKUISH_VERSION ?= 0.5.25
|
||||
NETRC_VERSION ?= 0.3.0
|
||||
PLUGN_VERSION ?= 0.6.1
|
||||
PROCFILE_VERSION ?= 0.11.0
|
||||
PLUGN_VERSION ?= 0.6.0
|
||||
SIGIL_VERSION ?= 0.6.0
|
||||
SSHCOMMAND_VERSION ?= 0.12.0
|
||||
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
|
||||
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
|
||||
DOCKER_IMAGE_LABELER_URL ?= https://github.com/dokku/docker-image-labeler/releases/download/v${DOCKER_IMAGE_LABELER_VERSION}/docker-image-labeler_${DOCKER_IMAGE_LABELER_VERSION}_linux_x86_64.tgz
|
||||
NETRC_URL ?= https://github.com/dokku/netrc/releases/download/v${NETRC_VERSION}/netrc_${NETRC_VERSION}_linux_x86_64.tgz
|
||||
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz
|
||||
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
|
||||
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/sigil_${SIGIL_VERSION}_Linux_x86_64.tgz
|
||||
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
|
||||
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
|
||||
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
|
||||
DOKKU_LIB_ROOT ?= /var/lib/dokku
|
||||
@@ -32,7 +36,7 @@ endif
|
||||
|
||||
include common.mk
|
||||
|
||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler netrc sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
||||
|
||||
include tests.mk
|
||||
include package.mk
|
||||
@@ -123,28 +127,31 @@ plugin-dependencies: plugn procfile-util
|
||||
plugins: plugn procfile-util docker
|
||||
sudo -E dokku plugin:install --core
|
||||
|
||||
dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq
|
||||
dependencies: apt-update docker-image-labeler netrc sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq
|
||||
$(MAKE) -e stack
|
||||
|
||||
apt-update:
|
||||
apt-get update -qq
|
||||
|
||||
jq:
|
||||
apt-get install -qq -y jq
|
||||
apt-get -qq -y --no-install-recommends install jq
|
||||
|
||||
dos2unix:
|
||||
apt-get install -qq -y dos2unix
|
||||
apt-get -qq -y --no-install-recommends install dos2unix
|
||||
|
||||
help2man:
|
||||
apt-get install -qq -y help2man
|
||||
apt-get -qq -y --no-install-recommends install help2man
|
||||
|
||||
man-db:
|
||||
apt-get install -qq -y man-db
|
||||
apt-get -qq -y --no-install-recommends install man-db
|
||||
|
||||
sshcommand:
|
||||
wget -qO /tmp/sshcommand_latest.tgz ${SSHCOMMAND_URL}
|
||||
tar xzf /tmp/sshcommand_latest.tgz -C /usr/local/bin
|
||||
sshcommand create dokku /usr/local/bin/dokku
|
||||
docker-image-labeler:
|
||||
wget -qO /tmp/docker-image-labeler_latest.tgz ${DOCKER_IMAGE_LABELER_URL}
|
||||
tar xzf /tmp/docker-image-labeler_latest.tgz -C /usr/local/bin
|
||||
|
||||
netrc:
|
||||
wget -qO /tmp/netrc_latest.tgz ${NETRC_URL}
|
||||
tar xzf /tmp/netrc_latest.tgz -C /usr/local/bin
|
||||
|
||||
procfile-util:
|
||||
wget -qO /tmp/procfile-util_latest.tgz ${PROCFILE_UTIL_URL}
|
||||
@@ -158,14 +165,19 @@ sigil:
|
||||
wget -qO /tmp/sigil_latest.tgz ${SIGIL_URL}
|
||||
tar xzf /tmp/sigil_latest.tgz -C /usr/local/bin
|
||||
|
||||
sshcommand:
|
||||
wget -qO /tmp/sshcommand_latest.tgz ${SSHCOMMAND_URL}
|
||||
tar xzf /tmp/sshcommand_latest.tgz -C /usr/local/bin
|
||||
sshcommand create dokku /usr/local/bin/dokku
|
||||
|
||||
docker:
|
||||
apt-get install -qq -y curl
|
||||
apt-get -qq -y --no-install-recommends install curl
|
||||
grep -i -E "^docker" /etc/group || groupadd docker
|
||||
usermod -aG docker dokku
|
||||
ifndef CI
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
ifdef DOCKER_VERSION
|
||||
apt-get install -qq -y docker-engine=${DOCKER_VERSION} || (apt-cache madison docker-engine ; exit 1)
|
||||
apt-get -qq -y --no-install-recommends install docker-engine=${DOCKER_VERSION} || (apt-cache madison docker-engine ; exit 1)
|
||||
endif
|
||||
sleep 2 # give docker a moment i guess
|
||||
endif
|
||||
|
||||
20
README.md
20
README.md
@@ -1,10 +1,11 @@
|
||||
# Dokku
|
||||
[](https://circleci.com/gh/dokku/dokku/tree/master)
|
||||
|
||||
[](https://github.com/dokku/dokku/actions?query=workflow%3ACI)
|
||||
[](https://packagecloud.io/dokku/dokku)
|
||||
[](https://aur.archlinux.org/packages/dokku/)
|
||||
[](https://webchat.freenode.net/?channels=dokku)
|
||||
[](https://glider-slackin.herokuapp.com/)
|
||||
[](http://dokku.viewdocs.io/dokku/)
|
||||
[](https://dokku.com/docs/)
|
||||
[](#sponsors)
|
||||
[](#backers)
|
||||
[](https://www.patreon.com/dokku/)
|
||||
@@ -46,7 +47,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
|
||||
<a href="https://opencollective.com/dokku/sponsor/28/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/dokku/sponsor/29/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/29/avatar.svg"></a>
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/dokku#backer)]
|
||||
@@ -99,29 +99,29 @@ 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.22.8/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.8 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.24.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.24.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
If you wish for a more unattended installation method, see [these](http://dokku.viewdocs.io/dokku/getting-started/install/debian/#unattended-installation) docs.
|
||||
If you wish for a more unattended installation method, see [these](https://dokku.com/docs/getting-started/install/debian/#unattended-installation) docs.
|
||||
|
||||
### Upgrade
|
||||
|
||||
[View the docs](http://dokku.viewdocs.io/dokku/getting-started/upgrading/) for upgrading from an older version of Dokku.
|
||||
[View the docs](https://dokku.com/docs/getting-started/upgrading/) for upgrading from an older version of Dokku.
|
||||
|
||||
## Documentation
|
||||
|
||||
Full documentation - including advanced installation docs - are available online at [http://dokku.viewdocs.io/dokku/](http://dokku.viewdocs.io/dokku/).
|
||||
Full documentation - including advanced installation docs - are available online at [https://dokku.com/docs/](https://dokku.com/docs/).
|
||||
|
||||
## Support
|
||||
|
||||
You can use [Github Issues](https://github.com/dokku/dokku/issues), check [Troubleshooting](http://dokku.viewdocs.io/dokku/getting-started/troubleshooting/) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku).
|
||||
You can use [Github Issues](https://github.com/dokku/dokku/issues), check [Troubleshooting](https://dokku.com/docs/getting-started/troubleshooting/) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku).
|
||||
|
||||
## Contribution
|
||||
|
||||
After checking [Github Issues](https://github.com/dokku/dokku/issues), the [Troubleshooting Guide](http://dokku.viewdocs.io/dokku/getting-started/troubleshooting/) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request.
|
||||
After checking [Github Issues](https://github.com/dokku/dokku/issues), the [Troubleshooting Guide](https://dokku.com/docs/getting-started/troubleshooting/) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request.
|
||||
|
||||
While we may not merge your PR as is, they serve to start conversations and improve the general Dokku experience for all users.
|
||||
|
||||
|
||||
7
Vagrantfile
vendored
7
Vagrantfile
vendored
@@ -55,7 +55,7 @@ Vagrant::configure("2") do |config|
|
||||
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
|
||||
end
|
||||
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git build-essential >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git build-essential >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
vm.vm.provision :shell do |s|
|
||||
s.inline = <<-EOT
|
||||
@@ -72,8 +72,9 @@ Vagrant::configure("2") do |config|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git dos2unix >/dev/null"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git dos2unix >/dev/null"
|
||||
vm.vm.provision :shell, :inline => "cd /vagrant/ && export DOKKU_BRANCH=`git symbolic-ref -q --short HEAD 2>/dev/null` && export DOKKU_TAG=`git describe --tags --exact-match 2>/dev/null` && cd /root/ && cp /vagrant/bootstrap.sh ./ && dos2unix bootstrap.sh && bash bootstrap.sh"
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
end
|
||||
|
||||
config.vm.define "dokku-deb", autostart: false do |vm|
|
||||
@@ -98,7 +99,7 @@ Vagrant::configure("2") do |config|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export IS_RELEASE=true && cd /root/dokku && make deb-all rpm-all"
|
||||
end
|
||||
|
||||
|
||||
20
bootstrap.sh
20
bootstrap.sh
@@ -22,7 +22,11 @@ log-fail() {
|
||||
|
||||
ensure-environment() {
|
||||
local FREE_MEMORY
|
||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||
if [[ -z "$DOKKU_TAG" ]]; then
|
||||
echo "Preparing to install $DOKKU_REPO..."
|
||||
else
|
||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||
fi
|
||||
|
||||
hostname -f >/dev/null 2>&1 || {
|
||||
log-fail "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
|
||||
@@ -31,7 +35,7 @@ ensure-environment() {
|
||||
FREE_MEMORY=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
if [[ "$FREE_MEMORY" -lt 1003600 ]]; then
|
||||
echo "For dokku to build containers, it is strongly suggested that you have 1024 megabytes or more of free memory"
|
||||
echo "If necessary, please consult this document to setup swap: http://dokku.viewdocs.io/dokku/getting-started/advanced-installation/#vms-with-less-than-1-gb-of-memory"
|
||||
echo "If necessary, please consult this document to setup swap: https://dokku.com/docs/getting-started/advanced-installation/#vms-with-less-than-1-gb-of-memory"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -42,13 +46,13 @@ install-requirements() {
|
||||
debian)
|
||||
if ! dpkg -l | grep -q software-properties-common; then
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install software-properties-common
|
||||
fi
|
||||
;;
|
||||
ubuntu)
|
||||
if ! dpkg -l | grep -q software-properties-common; then
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install software-properties-common
|
||||
fi
|
||||
|
||||
add-apt-repository universe >/dev/null
|
||||
@@ -97,10 +101,10 @@ install-dokku-from-source() {
|
||||
local DOKKU_CHECKOUT="$1"
|
||||
|
||||
if ! command -v apt-get &>/dev/null; then
|
||||
log-fail "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
log-fail "This installation script requires apt-get. For manual installation instructions, consult https://dokku.com/docs/getting-started/advanced-installation/"
|
||||
fi
|
||||
|
||||
apt-get -qq -y install sudo git make software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install sudo git make software-properties-common
|
||||
cd /root
|
||||
if [[ ! -d /root/dokku ]]; then
|
||||
git clone "$DOKKU_REPO" /root/dokku
|
||||
@@ -121,7 +125,7 @@ install-dokku-from-package() {
|
||||
install-dokku-from-rpm-package "$@"
|
||||
;;
|
||||
*)
|
||||
log-fail "Unsupported Linux distribution. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
log-fail "Unsupported Linux distribution. For manual installation instructions, consult https://dokku.com/docs/getting-started/advanced-installation/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -151,7 +155,7 @@ install-dokku-from-deb-package() {
|
||||
|
||||
echo "--> Initial apt-get update"
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install apt-transport-https
|
||||
apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
if ! command -v docker &>/dev/null; then
|
||||
echo "--> Installing docker"
|
||||
|
||||
@@ -2,6 +2,8 @@ GO_ARGS ?=
|
||||
GO_PLUGIN_MAKE_TARGET ?= build
|
||||
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
|
||||
|
||||
.PHONY: build-in-docker build clean src-clean
|
||||
|
||||
@@ -11,7 +13,8 @@ build-in-docker: clean
|
||||
mkdir -p /tmp/dokku-go-build-cache
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-v /tmp/dokku-go-build-cache:/root/.cache \
|
||||
-v $(GO_BUILD_CACHE):/root/.cache \
|
||||
-v $(GO_MOD_CACHE):/go/pkg/mod \
|
||||
-e PLUGIN_NAME=$(PLUGIN_NAME) \
|
||||
-e GO111MODULE=on \
|
||||
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
|
||||
|
||||
@@ -2,5 +2,5 @@ FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
@@ -2,7 +2,7 @@ FROM dokku/build-base:0.0.1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
ARG WORKDIR=/go/src/github.com/dokku/dokku
|
||||
|
||||
@@ -2,7 +2,7 @@ FROM dokku/build-base:0.0.1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
ARG GOLANG_VERSION
|
||||
@@ -35,7 +35,6 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
|
||||
IS_RELEASE=${IS_RELEASE} \
|
||||
SKIP_GO_CLEAN=true \
|
||||
make version copyfiles \
|
||||
&& make deb-dokku deb-sigil \
|
||||
rpm-dokku rpm-sigil
|
||||
&& make deb-dokku rpm-dokku
|
||||
|
||||
RUN ls -lha /tmp/
|
||||
|
||||
@@ -15,7 +15,7 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.22.8'
|
||||
VERSION = 'v0.24.2'
|
||||
|
||||
def bytes_to_string(b):
|
||||
if type(b) == bytes:
|
||||
@@ -154,7 +154,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
if 'vhost' in params and params['vhost'].value == 'true':
|
||||
vhost_enable = 'true'
|
||||
with open(vhost_filename, 'w') as f:
|
||||
f.write(params['hostname'].value)
|
||||
f.write(params['hostname'].value.strip("/"))
|
||||
shutil.chown(vhost_filename, dokku_user, dokku_group)
|
||||
else:
|
||||
try:
|
||||
@@ -165,7 +165,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
hostname_filename = '{0}/HOSTNAME'.format(dokku_root)
|
||||
|
||||
with open(hostname_filename, 'w') as f:
|
||||
f.write(params['hostname'].value)
|
||||
f.write(params['hostname'].value.strip("/"))
|
||||
|
||||
shutil.chown(hostname_filename, dokku_user, dokku_group)
|
||||
|
||||
@@ -341,7 +341,7 @@ PAGE = """
|
||||
<div class="form-group">
|
||||
<label for="key">Public SSH Keys</label><br />
|
||||
<textarea class="form-control" name="keys" rows="5" id="key" placeholder="Begins with 'ssh-rsa', 'ssh-dss', 'ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'">{ADMIN_KEYS}</textarea>
|
||||
<small class="form-text text-muted">Public keys allow users to ssh onto the server as the <code>dokku</code> user, as well as remotely execute Dokku commands. They are currently auto-populated from: <code>{AUTHORIZED_KEYS_LOCATION}</code>, and can be changed later via the <a href="http://dokku.viewdocs.io/dokku/deployment/user-management/" target="_blank"><code>dokku ssh-keys</code></a> plugin.</small>
|
||||
<small class="form-text text-muted">Public keys allow users to ssh onto the server as the <code>dokku</code> user, as well as remotely execute Dokku commands. They are currently auto-populated from: <code>{AUTHORIZED_KEYS_LOCATION}</code>, and can be changed later via the <a href="https://dokku.com/docs/deployment/user-management/" target="_blank"><code>dokku ssh-keys</code></a> plugin.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -352,7 +352,7 @@ PAGE = """
|
||||
<div class="form-group">
|
||||
<label for="hostname">Hostname</label>
|
||||
<input class="form-control" type="text" id="hostname" name="hostname" value="{HOSTNAME}" placeholder="A hostname or ip address such as {HOSTNAME}" />
|
||||
<small class="form-text text-muted">This will be used as the default host for all applications, and can be changed later via the <a href="http://dokku.viewdocs.io/dokku/configuration/domains/" target="_blank"><code>dokku domains:set-global</code></a> command.</small>
|
||||
<small class="form-text text-muted">This will be used as the default host for all applications, and can be changed later via the <a href="https://dokku.com/docs/configuration/domains/" target="_blank"><code>dokku domains:set-global</code></a> command.</small>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="vhost" name="vhost" value="true">
|
||||
@@ -406,7 +406,7 @@ PAGE = """
|
||||
result.classList.add("text-success");
|
||||
result.textContent = "Success! Redirecting in 3 seconds. .."
|
||||
setTimeout(function() {
|
||||
window.location.href = "http://dokku.viewdocs.io/dokku~{VERSION}/deployment/application-deployment/";
|
||||
window.location.href = "https://dokku.com/docs~{VERSION}/deployment/application-deployment/";
|
||||
}, 3000);
|
||||
})
|
||||
.catch(function (error) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"sudo apt-get update -qq >/dev/null",
|
||||
|
||||
"echo '--> Installing make requirement'",
|
||||
"sudo apt-get -qq -y install build-essential",
|
||||
"sudo apt-get -qq -y --no-install-recommends install build-essential",
|
||||
|
||||
"cd /tmp && make install-from-deb",
|
||||
"rm /root/.ssh/authorized_keys"
|
||||
|
||||
@@ -376,6 +376,8 @@ main() {
|
||||
NEXT_VERSION="$(fn-version-next "$CURRENT_VERSION" "$RELEASE")"
|
||||
IS_RELEASE="$(fn-is-release "$RELEASE")"
|
||||
|
||||
echo "v${NEXT_VERSION}" >build/next-version
|
||||
|
||||
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
|
||||
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package"
|
||||
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
|
||||
|
||||
@@ -95,7 +95,7 @@ EOF
|
||||
local AWS_RELEASE=true
|
||||
fi
|
||||
|
||||
if [[ "$CI" != "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
|
||||
if [[ "$AWS_RELEASE" == "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
|
||||
log-info "You are running this without a DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN environment variable."
|
||||
log-info "Doing so disables uploading releases to S3, which may be necessary for installing private plugins."
|
||||
while true; do
|
||||
|
||||
47
deb.mk
47
deb.mk
@@ -10,31 +10,17 @@ DOKKU_UPDATE_VERSION ?= 0.2.0
|
||||
DOKKU_UPDATE_ARCHITECTURE = amd64
|
||||
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb
|
||||
|
||||
define SIGIL_DESCRIPTION
|
||||
Standalone string interpolator and template processor
|
||||
Sigil is a command line tool for template processing
|
||||
and POSIX-compliant variable expansion. It was created
|
||||
for configuration templating, but can be used for any
|
||||
text processing.
|
||||
endef
|
||||
SIGIL_REPO_NAME ?= gliderlabs/sigil
|
||||
SIGIL_VERSION ?= 0.4.0
|
||||
SIGIL_ARCHITECTURE = amd64
|
||||
SIGIL_PACKAGE_NAME = gliderlabs_sigil_$(SIGIL_VERSION)_$(SIGIL_ARCHITECTURE).deb
|
||||
SIGIL_URL = https://github.com/gliderlabs/sigil/releases/download/v$(SIGIL_VERSION)/sigil_$(SIGIL_VERSION)_Linux_x86_64.tgz
|
||||
|
||||
ifndef IS_RELEASE
|
||||
IS_RELEASE = true
|
||||
endif
|
||||
|
||||
export SIGIL_DESCRIPTION
|
||||
|
||||
.PHONY: install-from-deb deb-all deb-dokku deb-dokku-update deb-setup deb-sigil
|
||||
.PHONY: install-from-deb deb-all deb-dokku deb-dokku-update deb-setup
|
||||
|
||||
install-from-deb:
|
||||
@echo "--> Initial apt-get update"
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y apt-transport-https
|
||||
sudo apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
@echo "--> Installing docker"
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
@@ -43,16 +29,16 @@ install-from-deb:
|
||||
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
|
||||
@echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $(shell lsb_release -cs 2>/dev/null || echo "bionic") main" | sudo tee /etc/apt/sources.list.d/dokku.list
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
|
||||
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get -qq -y --no-install-recommends install dokku
|
||||
|
||||
deb-all: deb-setup deb-dokku deb-sigil deb-dokku-update
|
||||
deb-all: deb-setup deb-dokku deb-dokku-update
|
||||
mv $(BUILD_DIRECTORY)/*.deb .
|
||||
@echo "Done"
|
||||
|
||||
deb-setup:
|
||||
@echo "-> Updating deb repository and installing build requirements"
|
||||
@sudo apt-get update -qq >/dev/null
|
||||
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 lintian >/dev/null 2>&1
|
||||
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian >/dev/null 2>&1
|
||||
@command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
@ssh -o StrictHostKeyChecking=no git@github.com || true
|
||||
|
||||
@@ -84,26 +70,3 @@ deb-dokku-update:
|
||||
--license 'MIT License' \
|
||||
contrib/dokku-update=/usr/local/bin/dokku-update \
|
||||
contrib/dokku-update-version=/var/lib/dokku-update/VERSION
|
||||
|
||||
deb-sigil:
|
||||
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Downloading package"
|
||||
wget -q -O /tmp/tmp/sigil-$(SIGIL_VERSION).tgz $(SIGIL_URL)
|
||||
cd /tmp/tmp/ && tar zxf /tmp/tmp/sigil-$(SIGIL_VERSION).tgz
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
cp /tmp/tmp/sigil /tmp/build/usr/bin/sigil && chmod +x /tmp/build/usr/bin/sigil
|
||||
|
||||
@echo "-> Creating $(SIGIL_PACKAGE_NAME)"
|
||||
sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \
|
||||
--version $(SIGIL_VERSION) \
|
||||
--architecture $(SIGIL_ARCHITECTURE) \
|
||||
--package $(BUILD_DIRECTORY)/$(SIGIL_PACKAGE_NAME) \
|
||||
--url "https://github.com/$(SIGIL_REPO_NAME)" \
|
||||
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
|
||||
--category utils \
|
||||
--description "$$SIGIL_DESCRIPTION" \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
|
||||
4
debian/control
vendored
4
debian/control
vendored
@@ -1,9 +1,9 @@
|
||||
Package: dokku
|
||||
Version: 0.22.8
|
||||
Version: 0.24.2
|
||||
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, net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
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, rsyslog, dos2unix, jq, unzip
|
||||
Recommends: herokuish (>= 0.3.4), parallel, 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>
|
||||
|
||||
@@ -1 +1 @@
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler
|
||||
|
||||
20
docker/usr/local/bin/docker-image-labeler
Executable file
20
docker/usr/local/bin/docker-image-labeler
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $TRACE ]] && set -x
|
||||
|
||||
main() {
|
||||
declare desc="re-runs docker-image-labeler commands as sudo"
|
||||
local DOCKER_IMAGE_LABELER_BIN=""
|
||||
if [[ -x "/usr/bin/docker-image-labeler" ]]; then
|
||||
DOCKER_IMAGE_LABELER_BIN="/usr/bin/docker-image-labeler"
|
||||
fi
|
||||
|
||||
if [[ -z "$DOCKER_IMAGE_LABELER_BIN" ]]; then
|
||||
echo "! No docker-image-labeler binary found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo -E "$DOCKER_IMAGE_LABELER_BIN" "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -32,7 +32,7 @@ To extract the backup onto another server, copy the backup to the server and ext
|
||||
sudo tar -xzvf path/to/dokku/backup.tar.gz -C /
|
||||
```
|
||||
|
||||
At this point, all datastores should be individually started and checked for data integrity. Once this is complete, individual applications can be rebuilt. Please consult the [process management documentation](/docs/deployment/process-management.md#rebuilding-apps) for more information on how to rebuild applications.
|
||||
At this point, all datastores should be individually started and checked for data integrity. Once this is complete, individual applications can be rebuilt. Please consult the [process management documentation](/docs/processes/process-management.md#rebuilding-apps) for more information on how to rebuild applications.
|
||||
|
||||
## Caveats
|
||||
|
||||
|
||||
@@ -24,6 +24,12 @@ Each "phase" has different expectations and limitations:
|
||||
- Example use-cases
|
||||
- Notifying slack that your app is deployed
|
||||
- Coordinating traffic routing with a central load balancer
|
||||
- `app.json`: `scripts.postdeploy`
|
||||
- When to use: This should be used when you wish to run a command _once_, after the app is created and not on subsequent deploys to the app.
|
||||
- Are changes committed to the image at this phase: No
|
||||
- Example use-cases
|
||||
- Setting up OAuth clients and DNS
|
||||
- Loading seed/test data into the app’s test database
|
||||
- `Procfile`: `release`
|
||||
- When to use: This should be used in conjunction with external systems to signal the completion of your app image build.
|
||||
- Are changes committed to the image at this phase: No
|
||||
@@ -44,6 +50,7 @@ Dokku provides limited support for the `app.json` manifest from Heroku (document
|
||||
|
||||
- `scripts.dokku.predeploy`: This is run _after_ an app's docker image is built, but _before_ any containers are scheduled. Changes made to your image are committed at this phase.
|
||||
- `scripts.dokku.postdeploy`: This is run _after_ an app's containers are scheduled. Changes made to your image are *not* committed at this phase.
|
||||
- `scripts.postdeploy`: This is run _after_ an app's containers are scheduled. Changes made to your image are *not* committed at this phase.
|
||||
|
||||
For buildpack-based deployments, the location of the `app.json` file should be at the root of your repository. Dockerfile-based app deploys should have the `app.json` in the configured `WORKDIR` directory; otherwise Dokku defaults to the buildpack app behavior of looking in `/app`.
|
||||
|
||||
@@ -57,7 +64,8 @@ The following is an example `app.json` file. Please note that only the `scripts.
|
||||
"dokku": {
|
||||
"predeploy": "touch /app/predeploy.test",
|
||||
"postdeploy": "curl https://some.external.api.service.com/deployment?state=success"
|
||||
}
|
||||
},
|
||||
"postdeploy": "curl https://some.external.api.service.com/created?state=success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ More information on supported Docker options can be found here: https://docs.doc
|
||||
|
||||
### Add Docker options
|
||||
|
||||
Add some options for the deployed/running app and when executing [`dokku run`](/docs/deployment/one-off-processes.md):
|
||||
Add some options for the deployed/running app and when executing [`dokku run`](/docs/processes/one-off-tasks.md):
|
||||
|
||||
```shell
|
||||
# Mount a host volume in a Docker container: "-v /host/path:/container/path"
|
||||
|
||||
@@ -40,7 +40,7 @@ dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/storage
|
||||
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage/node-js-app` to `/storage` inside the container.
|
||||
|
||||
Once you have mounted persistent storage, you will also need to restart the application. See the
|
||||
[process scaling documentation](/docs/deployment/process-management.md) for more information.
|
||||
[process scaling documentation](/docs/processes/process-management.md) for more information.
|
||||
|
||||
```shell
|
||||
dokku ps:restart app-name
|
||||
|
||||
@@ -35,35 +35,35 @@ dokku plugin:list
|
||||
|
||||
```
|
||||
plugn: dev
|
||||
00_dokku-standard 0.22.8 enabled dokku core standard plugin
|
||||
20_events 0.22.8 enabled dokku core events logging plugin
|
||||
app-json 0.22.8 enabled dokku core app-json plugin
|
||||
apps 0.22.8 enabled dokku core apps plugin
|
||||
build-env 0.22.8 enabled dokku core build-env plugin
|
||||
buildpacks 0.22.8 enabled dokku core buildpacks plugin
|
||||
certs 0.22.8 enabled dokku core certificate management plugin
|
||||
checks 0.22.8 enabled dokku core checks plugin
|
||||
common 0.22.8 enabled dokku core common plugin
|
||||
config 0.22.8 enabled dokku core config plugin
|
||||
docker-options 0.22.8 enabled dokku core docker-options plugin
|
||||
domains 0.22.8 enabled dokku core domains plugin
|
||||
enter 0.22.8 enabled dokku core enter plugin
|
||||
git 0.22.8 enabled dokku core git plugin
|
||||
logs 0.22.8 enabled dokku core logs plugin
|
||||
network 0.22.8 enabled dokku core network plugin
|
||||
nginx-vhosts 0.22.8 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.22.8 enabled dokku core plugin plugin
|
||||
proxy 0.22.8 enabled dokku core proxy plugin
|
||||
ps 0.22.8 enabled dokku core ps plugin
|
||||
repo 0.22.8 enabled dokku core repo plugin
|
||||
resource 0.22.8 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.22.8 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.22.8 enabled dokku core shell plugin
|
||||
ssh-keys 0.22.8 enabled dokku core ssh-keys plugin
|
||||
storage 0.22.8 enabled dokku core storage plugin
|
||||
tags 0.22.8 enabled dokku core tags plugin
|
||||
tar 0.22.8 enabled dokku core tar plugin
|
||||
trace 0.22.8 enabled dokku core trace plugin
|
||||
00_dokku-standard 0.24.2 enabled dokku core standard plugin
|
||||
20_events 0.24.2 enabled dokku core events logging plugin
|
||||
app-json 0.24.2 enabled dokku core app-json plugin
|
||||
apps 0.24.2 enabled dokku core apps plugin
|
||||
build-env 0.24.2 enabled dokku core build-env plugin
|
||||
buildpacks 0.24.2 enabled dokku core buildpacks plugin
|
||||
certs 0.24.2 enabled dokku core certificate management plugin
|
||||
checks 0.24.2 enabled dokku core checks plugin
|
||||
common 0.24.2 enabled dokku core common plugin
|
||||
config 0.24.2 enabled dokku core config plugin
|
||||
docker-options 0.24.2 enabled dokku core docker-options plugin
|
||||
domains 0.24.2 enabled dokku core domains plugin
|
||||
enter 0.24.2 enabled dokku core enter plugin
|
||||
git 0.24.2 enabled dokku core git plugin
|
||||
logs 0.24.2 enabled dokku core logs plugin
|
||||
network 0.24.2 enabled dokku core network plugin
|
||||
nginx-vhosts 0.24.2 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.24.2 enabled dokku core plugin plugin
|
||||
proxy 0.24.2 enabled dokku core proxy plugin
|
||||
ps 0.24.2 enabled dokku core ps plugin
|
||||
repo 0.24.2 enabled dokku core repo plugin
|
||||
resource 0.24.2 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.24.2 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.24.2 enabled dokku core shell plugin
|
||||
ssh-keys 0.24.2 enabled dokku core ssh-keys plugin
|
||||
storage 0.24.2 enabled dokku core storage plugin
|
||||
tags 0.24.2 enabled dokku core tags plugin
|
||||
tar 0.24.2 enabled dokku core tar plugin
|
||||
trace 0.24.2 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.
|
||||
|
||||
@@ -71,6 +71,17 @@ dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
|
||||
memory: 100
|
||||
```
|
||||
|
||||
A resource value can be individually cleared by setting the value to the special value `clear`.
|
||||
|
||||
```shell
|
||||
dokku resource:limit --cpu clear node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> Setting resource limits for node-js-app
|
||||
cpu: cleared
|
||||
```
|
||||
|
||||
#### Displaying Resource Limits
|
||||
|
||||
Running the `resource:limit` command without any flags will display the currently configured default app limits.
|
||||
@@ -169,6 +180,17 @@ dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
|
||||
memory: 100
|
||||
```
|
||||
|
||||
A resource value can be individually cleared by setting the value to the special value `clear`.
|
||||
|
||||
```shell
|
||||
dokku resource:reserve --cpu clear node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> Setting resource reservation for node-js-app
|
||||
cpu: cleared
|
||||
```
|
||||
|
||||
#### Displaying Resource Reservations
|
||||
|
||||
Running the `resource:reserve` command without any flags will display the currently configured default app reservations.
|
||||
|
||||
8
docs/appendices/0.23.0-migration-guide.md
Normal file
8
docs/appendices/0.23.0-migration-guide.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# 0.23.0 Migration Guide
|
||||
|
||||
## Changes
|
||||
|
||||
- The `plugin:list` command no longer outputs the version for the `plugn` binary.
|
||||
- Users building docker images that run Dokku will need to use a new sudoer wrapper for the `docker-image-labeler` binary to work correctly. A reference version has been placed in the `docker` skeleton directory. This should only impact platform developers, and users of our Docker image will already have the file available.
|
||||
- The `dokku` user's cron is now in use by Dokku itself. Customizations will be overwritten. Users are encouraged to use a cron entry in `/etc/cron.d/dokku` to avoid this issue.
|
||||
- As of 0.23.0, Dokku will now inject the `max-size` log driver option for applications. This is restricted to app-configured log driver values empty, `local` or `json-file` in 0.23.1 to increase setup compatibility. Users who configure alternative log drivers at the system level will need to either set the global `max-size` property to `unlimited` or switch to the built-in `vector` logging support.
|
||||
12
docs/appendices/0.24.0-migration-guide.md
Normal file
12
docs/appendices/0.24.0-migration-guide.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# 0.24.0 Migration Guide
|
||||
|
||||
## Changes
|
||||
|
||||
- The commands `proxy:enable`, `proxy:disable` and `proxy:build-config` now support the `--all` flag in addition to general parallelism.
|
||||
- The `builder-cnb` plugin has been renamed `builder-pack`, and all related plugin triggers have had the suffix `-cnb` changed to `-pack`.
|
||||
|
||||
## Deprecations
|
||||
|
||||
- The 1.0.0 release of Dokku will no longer select buildpack builders over dockerfile builders if both builders match. Instead, Dokku will choose the first builder that responds to the `builder-detect` trigger. Users that wish to use a specific builder may set a builder using the `builder:set` command, which will force Dokku to use the specified builder regardless of what might be auto-detected.
|
||||
- The `tags` plugin is deprecated in favor of the [`git:from-image`](/docs/deployment/methods/git.md#initializing-an-app-repository-from-a-docker-image) command. It will be removed in the next minor release, and is considered unmaintained. Users are highly encouraged to switch their workflows to `git:from-image`.
|
||||
- The `tar` plugin 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 the next minor release, and is considered unmaintained. Users are highly encouraged to switch their workflows to `git:from-archive`.
|
||||
@@ -20,6 +20,6 @@
|
||||
|
||||
## Dockerfile apps with exposed ports
|
||||
|
||||
- Dockerfiles with `EXPOSE` clauses will get [all **tcp** ports proxied by default](/docs/deployment/methods/dockerfiles.md#exposed-ports)
|
||||
- Dockerfiles with `EXPOSE` clauses will get [all **tcp** ports proxied by default](/docs/deployment/builders/dockerfiles.md#exposed-ports)
|
||||
- Note that nginx will proxy the same port numbers to listen publicly
|
||||
- UDP ports can be exposed by disabling the [nginx proxy](/docs/advanced-usage/proxy-management.md) with `dokku proxy:disable node-js-app`
|
||||
- UDP ports can be exposed by disabling the [nginx proxy](/docs/networking/proxy-management.md) with `dokku proxy:disable node-js-app`
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
## Proxy port mapping
|
||||
|
||||
- You can now configure host -> container proxy port mappings
|
||||
- The UI is handled by the [proxy](/docs/advanced-usage/proxy-management.md) interface plugin by setting the `DOKKU_PROXY_PORT_MAP` config variable in the format of `scheme:host-port:container-port`. The default `nginx-vhosts` proxy plugin supports both the `http` and `https` schemes.
|
||||
- The UI is handled by the [proxy](/docs/networking/proxy-management.md) interface plugin by setting the `DOKKU_PROXY_PORT_MAP` config variable in the format of `scheme:host-port:container-port`. The default `nginx-vhosts` proxy plugin supports both the `http` and `https` schemes.
|
||||
- Default port mappings
|
||||
- buildpack apps will be set to `http:80:5000` and will also include `https:443:5000` if SSL is enabled.
|
||||
- dockerfile apps with explicitly exposed ports (i.e. using the `EXPOSE` directive) will be configured with a listener on each exposed port that proxies to the same port of the deployed application container.
|
||||
- You may override this behavior with the [`proxy:ports-*` commands](/docs/advanced-usage/proxy-management.md) or by directly setting `DOKKU_PROXY_PORT_MAP` with the `config:set` command
|
||||
- You may override this behavior with the [`proxy:ports-*` commands](/docs/networking/proxy-management.md) or by directly setting `DOKKU_PROXY_PORT_MAP` with the `config:set` command
|
||||
- dockerfile apps without explicitly exposed ports will behave the same as a buildpack app
|
||||
- NOTE: These defaults **are not** automatically changed on subsequent pushes and must be manipulated with the aforementioned commands
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ We should now properly handle file ownership for mounted directories. This was e
|
||||
|
||||
## Restart Policies
|
||||
|
||||
If you previously managed container restart policies via docker-options, these can now be managed natively via the built-in `ps` plugin. There is no migration necessary. See the [restart policy documentation](/docs/deployment/process-management.md#restart-policies) for more details.
|
||||
If you previously managed container restart policies via docker-options, these can now be managed natively via the built-in `ps` plugin. There is no migration necessary. See the [restart policy documentation](/docs/processes/process-management.md#restart-policies) for more details.
|
||||
|
||||
## SSH Keys
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/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.22.8\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.8\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.8\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.8\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.8\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.8\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.24.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 62.5%;
|
||||
font-size: 62.5%;
|
||||
font-weight: 400;
|
||||
padding-bottom: 40px;
|
||||
color: #5a5a5a;
|
||||
@@ -39,13 +42,13 @@ h1 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.header .navbar-brand a {
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/dokku.png);
|
||||
text-indent: 40px;
|
||||
}
|
||||
.blurb {
|
||||
color: #424242;
|
||||
background-color: #ededed;
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -231,7 +234,7 @@ h1 {
|
||||
}
|
||||
.list-group-item {
|
||||
border: none;
|
||||
font-size: 1.1em;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: .2rem .5rem;
|
||||
color: #157577;
|
||||
@@ -317,7 +320,7 @@ a.list-group-item {
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
font-size: 1.2em;
|
||||
font-size: 1em;
|
||||
border-radius: 0 0 0 5px;
|
||||
padding: 0 0.5em;
|
||||
text-shadow: none;
|
||||
@@ -654,3 +657,74 @@ ul.fas li .fa-large:before, ul.fas li .fa-large:before {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: rgb(13, 17, 23);
|
||||
}
|
||||
.header {
|
||||
background-color: #075c9b;
|
||||
}
|
||||
.blurb {
|
||||
filter: invert(1);
|
||||
}
|
||||
.slack-channel {
|
||||
background-color: #110e09;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: rgb(22, 27, 34);
|
||||
color: #bbb;
|
||||
}
|
||||
pre {
|
||||
background-color: rgb(22, 27, 34);
|
||||
color: #bbb;
|
||||
border: 1px solid #555;
|
||||
box-shadow: 0 0 0 3px #111;
|
||||
}
|
||||
.highlight-show-language-label {
|
||||
filter: invert(1);
|
||||
}
|
||||
.list-group-item {
|
||||
background-color: rgb(13, 17, 23);
|
||||
}
|
||||
blockquote {
|
||||
background-color: rgba(0, 82, 204, 0.18);
|
||||
border-left: 4px solid rgba(108, 169, 255, 0.3);;
|
||||
color: rgb(108, 169, 255);
|
||||
}
|
||||
blockquote.warning {
|
||||
border-left: 4px solid rgba(239, 136, 84, 0.3);
|
||||
background-color: rgba(235, 100, 32, 0.18);
|
||||
color: rgb(239, 136, 84);
|
||||
}
|
||||
blockquote.new-as-of {
|
||||
border-left: 4px solid rgba(11, 216, 73, 0.3);
|
||||
background-color: rgba(9, 171, 60, 0.18);
|
||||
color: rgb(11, 216, 73);
|
||||
}
|
||||
.dev-warning, .outdated-warning {
|
||||
background-color: #ccb430
|
||||
}
|
||||
.table-striped tbody tr:nth-of-type(odd) {
|
||||
background-color: #080808
|
||||
}
|
||||
.table-hover tbody tr:hover {
|
||||
background-color: #3b3b3b;
|
||||
color: #bbb;
|
||||
}
|
||||
.table td, .table th {
|
||||
border-top: 1px solid #131110;
|
||||
}
|
||||
.table thead th {
|
||||
border-bottom: 2px solid #131110;
|
||||
}
|
||||
.markdown-body {
|
||||
color: rgb(184, 181, 171);
|
||||
}
|
||||
.markdown-body h1 {
|
||||
color: #bbb;
|
||||
}
|
||||
.markdown-body h2, .markdown-body h3, .markdown-body h4 {
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
"0.19.13",
|
||||
"0.20.4",
|
||||
"0.21.4",
|
||||
"0.22.8"
|
||||
"0.22.9",
|
||||
"0.23.9",
|
||||
"0.24.2"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ The following plugins are available and provided by Dokku maintainers. Please f
|
||||
| [Application build hook](https://github.com/fteychene/dokku-build-hook) | [fteychene][] | 0.4.0+ |
|
||||
| [Post Deploy Script](https://github.com/baikunz/dokku-post-deploy-script) | [baikunz][] | 0.4.0+ |
|
||||
| [Auto Sync](https://github.com/IdeaSynthesis/dokku-autosync)<sup>4</sup> | [fomojola][] | 0.8.1+ |
|
||||
| [Deploy Webhook](https://github.com/IdeaSynthesis/dokku-deploy-webhook)<sup>5</sup> | [fomojola][] | 0.8.1+ |
|
||||
|
||||
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
|
||||
|
||||
@@ -211,7 +212,9 @@ The following plugins are available and provided by Dokku maintainers. Please f
|
||||
|
||||
<sup>3</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
|
||||
|
||||
<sup>4</sup> Adds the ability to sync an application repo with a remote Github repo (useful for automated rebuilds without needing a git push from an external system).
|
||||
<sup>4</sup> Adds the ability to sync an application repo with a remote Github repo (useful for automated rebuilds without needing a git push from an external system
|
||||
|
||||
<sup>5</sup> Adds the ability to invoke a post-deploy webhook with the IP, port and app name, all with a single config:set).
|
||||
|
||||
### Other Plugins
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ The following config variables have special meanings and can be set in a variety
|
||||
| Name | Default | How to modify | Description |
|
||||
| ------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `DOKKU_ROOT` | `~dokku` | `/etc/environment` | The root directory where dokku will store application repositories, as well as certain configuration files. |
|
||||
| `DOKKU_IMAGE` | `gliderlabs/herokuish` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The default image to use when building herokuish containers. |
|
||||
| `DOKKU_IMAGE` | `gliderlabs/herokuish` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The default image to use when building herokuish containers. Deprecated in favor of using `buildpacks:set-property` |
|
||||
| `DOKKU_LIB_ROOT` | `/var/lib/dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory where plugins, certain data, and general configuration is stored. |
|
||||
| `PLUGIN_PATH` | `$DOKKU_LIB_ROOT/plugins"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The top-level directory where plugins are stored. |
|
||||
| `PLUGIN_AVAILABLE_PATH` | `$PLUGIN_PATH/available"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that holds all available plugins, including core. |
|
||||
@@ -91,7 +91,7 @@ The following config variables have special meanings and can be set in a variety
|
||||
| `DOKKU_EVENTS_LOGFILE` | `$DOKKU_LOGS_DIR/events.log` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where the events log file is written to. |
|
||||
| `DOKKU_APP_NAME` | none | `--app APP` flag | Name of application to work on. Respected by core plugins. |
|
||||
| `DOKKU_APPS_FORCE_DELETE` | none | `--force` flag | Whether to force delete an application. Also used by other plugins for destructive actions. |
|
||||
| `DOKKU_CHECKS_URL` | `http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Url displayed during deployment when no CHECKS file exists. |
|
||||
| `DOKKU_CHECKS_URL` | `https://dokku.com/docs/deployment/zero-downtime-deploys/` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Url displayed during deployment when no CHECKS file exists. |
|
||||
| `DOKKU_DETACH_CONTAINER` | none | `--detach` flag | Whether to detach a container started via `dokku run`. |
|
||||
| `DOKKU_QUIET_OUTPUT` | none | `--quiet` flag | Silences certain header output for `dokku` commands. |
|
||||
| `DOKKU_RM_CONTAINER` | none | `dokku config:set` <br /> `--rm-container` flag <br /> `--rm` flag | Whether to keep `dokku run` containers around or not. |
|
||||
|
||||
@@ -61,6 +61,20 @@ The following options are also available via the `nginx:set` command:
|
||||
|
||||
Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails until the max-age is reached.
|
||||
|
||||
#### Globally disabling the HSTS Header
|
||||
|
||||
HSTS Header can be disabled for all apps by setting the `hsts` property to false after passing the `--global` flag to `nginx:set`. Changing this value globally or on a per-app basis will require rebuilding the nginx config via the `proxy:build-config` command.
|
||||
|
||||
```shell
|
||||
dokku nginx:set --global hsts false
|
||||
```
|
||||
|
||||
Once the HSTS setting is disabled globally, it can be re-enabled on a per-app basis by setting the `hsts` property as normal.
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app hsts true
|
||||
```
|
||||
|
||||
### Checking access logs
|
||||
|
||||
You may check nginx access logs via the `nginx:access-logs` command. This assumes that app access logs are being stored in `/var/log/nginx/$APP-access.log`, as is the default in the generated `nginx.conf`.
|
||||
@@ -77,7 +91,7 @@ dokku nginx:access-logs node-js-app -t
|
||||
|
||||
### Checking error logs
|
||||
|
||||
You may check nginx error logs via the `nginx:access-logs` command. This assumes that app error logs are being stored in `/var/log/nginx/$APP-error.log`, as is the default in the generated `nginx.conf`.
|
||||
You may check nginx error logs via the `nginx:error-logs` command. This assumes that app error logs are being stored in `/var/log/nginx/$APP-error.log`, as is the default in the generated `nginx.conf`.
|
||||
|
||||
```shell
|
||||
dokku nginx:error-logs node-js-app
|
||||
@@ -144,6 +158,28 @@ dokku nginx:set node-js-app proxy-read-timeout
|
||||
|
||||
In all cases, the nginx config must be regenerated after setting the above value.
|
||||
|
||||
### Specifying a custom client_max_body_size
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
Users can override the default `client_max_body_size` value - which limits file uploads - via `nginx:set`. Changing this value will only apply to every `server` stanza of the default `nginx.conf.sigil`; users of custom `nginx.conf.sigil` files must update their templates to support the new value.
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app client-max-body-size 50m
|
||||
```
|
||||
|
||||
The default value is empty string, which will result in nginx falling back to any configured, higher-level defaults (or `1m` if unconfigued; all numerical values _must_ have a size unit specified (`k` for kilobytes, `m` for megabytes).
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app client-max-body-size
|
||||
```
|
||||
|
||||
In all cases, the nginx config must be regenerated after setting the above value.
|
||||
|
||||
Changing this value when using the PHP buildpack (or any other buildpack that uses an intermediary server) will require changing the value in the server config shipped with that buildpack. Consult your buildpack documentation for further details.
|
||||
|
||||
### Showing the nginx config
|
||||
|
||||
For debugging purposes, it may be useful to show the nginx config. This can be achieved via the `nginx:show-config` command.
|
||||
@@ -233,11 +269,11 @@ The default nginx.conf template will include everything from your apps `nginx.co
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
```
|
||||
|
||||
That means you can put additional configuration in separate files, for example to limit the uploaded body size to 50 megabytes, do
|
||||
That means you can put additional configuration in separate files. To increase the client request header timeout, the following can be performed:
|
||||
|
||||
```shell
|
||||
mkdir /home/dokku/node-js-app/nginx.conf.d/
|
||||
echo 'client_max_body_size 50m;' > /home/dokku/node-js-app/nginx.conf.d/upload.conf
|
||||
echo 'client_header_timeout 50s;' > /home/dokku/node-js-app/nginx.conf.d/timeout.conf
|
||||
chown dokku:dokku /home/dokku/node-js-app/nginx.conf.d/upload.conf
|
||||
service nginx reload
|
||||
```
|
||||
@@ -250,7 +286,7 @@ For PHP Buildpack users, you will also need to provide a `Procfile` and an accom
|
||||
|
||||
Your `nginx.conf` file - not to be confused with Dokku's `nginx.conf.sigil` - would also need to be configured as shown in this example:
|
||||
|
||||
client_max_body_size 50m;
|
||||
client_header_timeout 50s;
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
@@ -336,12 +372,12 @@ See the [ssl documentation](/docs/configuration/ssl.md) for more information on
|
||||
|
||||
### Disabling Nginx
|
||||
|
||||
See the [proxy documentation](/docs/advanced-usage/proxy-management.md) for more information on how to disable nginx as the proxy implementation for your app.
|
||||
See the [proxy documentation](/docs/networking/proxy-management.md) for more information on how to disable nginx as the proxy implementation for your app.
|
||||
|
||||
### Managing Proxy Port mappings
|
||||
|
||||
See the [proxy documentation](/docs/advanced-usage/proxy-management.md#proxy-port-mapping) for more information on how to manage ports proxied for your app.
|
||||
See the [proxy documentation](/docs/networking/proxy-management.md#proxy-port-mapping) for more information on how to manage ports proxied for your app.
|
||||
|
||||
### Regenerating nginx config
|
||||
|
||||
See the [proxy documentation](/docs/advanced-usage/proxy-management.md#regenerating-proxy-config) for more information on how to rebuild the nginx proxy configuration for your app.
|
||||
See the [proxy documentation](/docs/networking/proxy-management.md#regenerating-proxy-config) for more information on how to rebuild the nginx proxy configuration for your app.
|
||||
|
||||
@@ -18,7 +18,7 @@ certs:update <app> CRT KEY # Update an SSL Endpoint on an app. Can
|
||||
dokku nginx:import-ssl <app> < certs.tar
|
||||
```
|
||||
|
||||
> Adding an ssl certificate before deploying an application will result in port mappings being updated. This may cause issues for applications that use non-standard ports, as those may not be automatically detected. Please refer to the [proxy documentation](/docs/advanced-usage/proxy-management.md) for information as to how to reconfigure the mappings.
|
||||
> Adding an ssl certificate before deploying an application will result in port mappings being updated. This may cause issues for applications that use non-standard ports, as those may not be automatically detected. Please refer to the [proxy documentation](/docs/networking/proxy-management.md) for information as to how to reconfigure the mappings.
|
||||
|
||||
## Per-application certificate management
|
||||
|
||||
@@ -136,35 +136,12 @@ Certain versions of nginx have bugs that prevent [HTTP/2](https://nginx.org/en/d
|
||||
|
||||
Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarded-Port` and `X-Forwarded-For`. These headers indicate the protocol of the original request (HTTP or HTTPS), the port number, and the IP address of the client making the request, respectively. The default configuration is for Nginx to set these headers.
|
||||
|
||||
If your server runs behind an HTTP(S) load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by using a [custom nginx template](/docs/configuration/nginx.md#customizing-the-nginx-configuration). The following is a simple example of how to do so.
|
||||
If your server runs behind an HTTP(S) load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application via `nginx:set`:
|
||||
|
||||
```go
|
||||
server {
|
||||
listen [::]:{{ .PROXY_PORT }};
|
||||
listen {{ .PROXY_PORT }};
|
||||
server_name {{ .NOSSL_SERVER_NAME }};
|
||||
access_log /var/log/nginx/{{ .APP }}-access.log;
|
||||
error_log /var/log/nginx/{{ .APP }}-error.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://{{ .APP }};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
|
||||
proxy_set_header X-Request-Start $msec;
|
||||
}
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
}
|
||||
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_WEB_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
```shell
|
||||
dokku nginx:set node-js-app x-forwarded-for-value "\$http_x_forwarded_for"
|
||||
dokku nginx:set node-js-app x-forwarded-port-value "\$http_x_forwarded_port"
|
||||
dokku nginx:set node-js-app x-forwarded-proto-value "\$http_x_forwarded_proto"
|
||||
```
|
||||
|
||||
Only use this option if:
|
||||
@@ -173,7 +150,18 @@ Only use this option if:
|
||||
|
||||
If it's possible to make HTTP(S) requests directly to Nginx, bypassing the load balancer, or if the load balancer is not configured to set these headers, then it becomes possible for a client to set these headers to arbitrary values.
|
||||
|
||||
This could result in security issue, for example, if your application looks at the value of the `X-Forwarded-Proto` to determine if the request was made over HTTPS.
|
||||
The `x-forwarded-ssl` property may also be set for application frameworks that require this value. Note that this is a non-standard version of setting `x-forwarded-proto` to `https`, and should only be done as a last resort.
|
||||
|
||||
```shell
|
||||
# force-setting value to `on`
|
||||
dokku nginx:set node-js-app x-forwarded-ssl on
|
||||
|
||||
# force-setting value to `off`
|
||||
dokku nginx:set node-js-app x-forwarded-ssl on
|
||||
|
||||
# removing the value from nginx.conf (default)
|
||||
dokku nginx:set node-js-app x-forwarded-ssl
|
||||
```
|
||||
|
||||
### SSL Port Exposure
|
||||
|
||||
|
||||
@@ -102,9 +102,9 @@ Once the deploy is complete, the application's web URL will be generated as abov
|
||||
|
||||
Dokku supports deploying applications in a few ways:
|
||||
|
||||
- [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) via [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks): See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) to learn about the different ways to specify a buildpack.
|
||||
- [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) via [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks): See the [herokuish buildpacks documentation](/docs/deployment/builders/herokuish-buildpacks.md) to learn about the different ways to specify a buildpack.
|
||||
- This is the default method used by Dokku.
|
||||
- [Dockerfile](https://docs.docker.com/reference/builder/): See the [dockerfile documentation](/docs/deployment/methods/dockerfiles.md) to learn about the different ways to configure Dockerfile-based deploys.
|
||||
- [Dockerfile](https://docs.docker.com/reference/builder/): See the [dockerfile documentation](/docs/deployment/builders/dockerfiles.md) to learn about the different ways to configure Dockerfile-based deploys.
|
||||
- [Docker Image](https://docs.docker.com/get-started/overview/#docker-objects): See the [docker image documentation](/docs/deployment/methods/images.md) to learn about how to deploy a Docker Image.
|
||||
|
||||
### Skipping deployment
|
||||
@@ -125,7 +125,7 @@ If you need to redeploy or restart your app:
|
||||
dokku ps:rebuild ruby-getting-started
|
||||
```
|
||||
|
||||
See the [process scaling documentation](/docs/deployment/process-management.md) for more information on how to manage your app processes.
|
||||
See the [process scaling documentation](/docs/processes/process-management.md) for more information on how to manage your app processes.
|
||||
|
||||
### Deploying with private Git submodules
|
||||
|
||||
@@ -205,7 +205,7 @@ See the [Git documentation](/docs/deployment/methods/git.md#changing-the-deploy-
|
||||
|
||||
## Dockerfile deployment
|
||||
|
||||
See the [Dockerfile documentation](/docs/deployment/methods/dockerfiles.md) for information Dokku's Dockerfile support.
|
||||
See the [Dockerfile documentation](/docs/deployment/builders/dockerfiles.md) for information Dokku's Dockerfile support.
|
||||
|
||||
## Image tagging
|
||||
|
||||
@@ -213,7 +213,7 @@ See the [image tagging documentation](/docs/deployment/methods/images.md) for mo
|
||||
|
||||
## Specifying a custom buildpack
|
||||
|
||||
See the [herokuish buildpack documentation](/docs/deployment/methods/herokuish-buildpacks.md) for more information on how to specify a set of custom buildpacks for your application.
|
||||
See the [herokuish buildpack documentation](/docs/deployment/builders/herokuish-buildpacks.md) for more information on how to specify a set of custom buildpacks for your application.
|
||||
|
||||
## Removing a deployed app
|
||||
|
||||
|
||||
108
docs/deployment/builders/builder-management.md
Normal file
108
docs/deployment/builders/builder-management.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# Builder Management
|
||||
|
||||
> New as of 0.24.0
|
||||
|
||||
```
|
||||
builder:report [<app>] [<flag>] # Displays a builder report for one or more apps
|
||||
builder:set <app> <key> (<value>) # Set or clear a builder property for an app
|
||||
```
|
||||
|
||||
Builders are a way of customizing how an app is built from a source, allowing users flexibility in how artifacts are created for later scheduling.
|
||||
|
||||
## Usage
|
||||
|
||||
### Builder selection
|
||||
|
||||
Dokku supports the following built-in builders:
|
||||
|
||||
- `builder-dockerfile`: Builds apps using a `Dockerfile` via `docker build`. See the [dockerfile builder documentation](/docs/deployment/builders/dockerfiles.md) for more information on how this builder functions.
|
||||
- `builder-herokuish`: Builds apps with Heroku's v2a Buildpack specification via `gliderlabs/herokuish`. See the [herokuish builder documentation](/docs/deployment/builders/herokuish-buildpacks.md) for more information on how this builder functions.
|
||||
- `builder-pack`: Builds apps with Cloud Native Buildpacks via the `pack-cli` tool. See the [cloud native buildpacks builder documentation](/docs/deployment/builders/cloud-native-buildpacks.md) for more information on how this builder functions.
|
||||
|
||||
Builders run a detection script against a source code repository, and the first detected builder will be used to build the app artifact. The exception to this is when a `Dockerfile` is detected and the app is also able to use either `herokuish` or `pack-cli` for building, in which case one of the latter will be chosen.
|
||||
|
||||
### Overriding the auto-selected builder
|
||||
|
||||
If desired, the builder can be specified via the `builder:set` command by speifying a value for `selected`. The selected builder will always be used.
|
||||
|
||||
```shell
|
||||
dokku builder:set node-js-app selected dockerfile
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
```shell
|
||||
dokku builder:set node-js-app selected
|
||||
```
|
||||
|
||||
The `selected` property can also be set globally. The global default is an empty string, and auto-detection will be performed when no value is set per-app or globally.
|
||||
|
||||
```shell
|
||||
dokku builder:set --global selected herokuish
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option.
|
||||
|
||||
```shell
|
||||
dokku builder:set --global selected
|
||||
```
|
||||
|
||||
### Displaying builder reports for an app
|
||||
|
||||
You can get a report about the app's builder status using the `builder:report` command:
|
||||
|
||||
```shell
|
||||
dokku builder:report
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app builder information
|
||||
Builder computed selected: herokuish
|
||||
Builder global selected: herokuish
|
||||
Builder selected: herokuish
|
||||
=====> python-sample builder information
|
||||
Builder computed selected: dockerfile
|
||||
Builder global selected: herokuish
|
||||
Builder selected: dockerfile
|
||||
=====> ruby-sample builder information
|
||||
Builder computed selected: herokuish
|
||||
Builder global selected: herokuish
|
||||
Builder selected:
|
||||
```
|
||||
|
||||
You can run the command for a specific app also.
|
||||
|
||||
```shell
|
||||
dokku builder:report node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app builder information
|
||||
Builder selected: herokuish
|
||||
```
|
||||
|
||||
You can pass flags which will output only the value of the specific information you want. For example:
|
||||
|
||||
```shell
|
||||
dokku builder:report node-js-app --builder-selected
|
||||
```
|
||||
|
||||
### Custom builders
|
||||
|
||||
To create a custom builder, the following triggers must be implemented:
|
||||
|
||||
- `builder-build`:
|
||||
- arguments: `BUILDER_TYPE` `APP` `SOURCECODE_WORK_DIR`
|
||||
- description: Creates a docker image named with the output of `common#get_app_image_name $APP`.
|
||||
- `builder-detect`:
|
||||
- arguments: `APP` `SOURCECODE_WORK_DIR`
|
||||
- description: Outputs the name of the builder (without the `builder-` prefix) to use to build the app.
|
||||
- `builder-release`:
|
||||
- arguments: `BUILDER_TYPE` `APP` `IMAGE_AG`
|
||||
- description: A post-build, pre-release trigger that can be used to post-process the image. Usually simply tags and labels the image appropriately.
|
||||
|
||||
Custom plugins names _must_ have the prefix `builder-` or builder overriding via `builder:set` may not function as expected.
|
||||
|
||||
Builders can use any tools available on the system to build the docker image, and may even be used to schedule building off-server. The only current requirement is that the image must exist on the server at the end of the `builder-build` command, though this requirement may be relaxed in a future release.
|
||||
|
||||
For a simple example of how to implement this trigger, see `builder-pack`, which utilizes a cli tool - `pack-cli` - to generate an OCI image that is compatible with Docker and can be scheduled by the official scheduling plugins.
|
||||
80
docs/deployment/builders/cloud-native-buildpacks.md
Normal file
80
docs/deployment/builders/cloud-native-buildpacks.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Cloud Native Buildpacks (Experimental)
|
||||
|
||||
> New as of 0.22.0
|
||||
|
||||
```
|
||||
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
||||
```
|
||||
|
||||
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/builders/herokuish-buildpacks.md) for more information on how to clear buildpack build cache for an application.
|
||||
|
||||
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
|
||||
|
||||
## Usage
|
||||
|
||||
### Detection
|
||||
|
||||
This builder will be auto-detected in either the following cases:
|
||||
|
||||
- The `DOKKU_CNB_EXPERIMENTAL` app environment variable is set to `1`.
|
||||
```shell
|
||||
dokku config:set --no-restart node-js-app DOKKU_CNB_EXPERIMENTAL=1
|
||||
```
|
||||
- A `.project.toml` file exists in the root of the app repository.
|
||||
- This file is consumed by `pack-cli` and used to describe how the app is built.
|
||||
|
||||
The builder can also be specified via the `builder:set` command:
|
||||
|
||||
```shell
|
||||
dokku builder:set node-js-app selected pack
|
||||
```
|
||||
|
||||
> Dokku will only select the `dockerfile` builder if both the `herokuish` and `pack` builders are not detected and a Dockerfile exists. See the [dockerfile builder documentation](/docs/deployment/builders/dockerfiles.md) for more information on how that builder functions.
|
||||
|
||||
### Requirements
|
||||
|
||||
The `pack` cli tool is not included by default with Dokku or as a dependency. It must also be installed as shown on [this page](https://buildpacks.io/docs/tools/pack/).
|
||||
|
||||
Builds will proceed with the `pack` cli for the app from then on.
|
||||
|
||||
### Caveats
|
||||
|
||||
As this functionality is highly experimental, there are a number of caveats. Please note that not all issuesare listed below.
|
||||
|
||||
- Specifying specific buildpacks is not currently possible.
|
||||
- A future release will add support for specifying buildpacks via the `buildpacks` plugin.
|
||||
- There is currently no way to specify extra arguments for `pack` cli invocations.
|
||||
- A future release will add support for injecting extra arguments during the build process.
|
||||
- The default process type is `web`.
|
||||
- Build cache is stored in Docker volumes instead of on disk. As such, `repo:purge-cache` currently has no effect.
|
||||
- A future version will add integration with the `repo` plugin.
|
||||
- `pack` is not currently included with Dokku, nor is it added as a package dependency.
|
||||
- A future version will include it as a package dependency.
|
||||
|
||||
### Customizing the Buildpack stack builder
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
The default stack builder in use by CNB buildpacks in Dokku is based on `heroku/buildpacks`. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack paketobuildpacks/build:base-cnb
|
||||
```
|
||||
|
||||
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack
|
||||
```
|
||||
|
||||
A change in the stack builder value will execute the `post-stack-set` trigger.
|
||||
|
||||
Finally, stack builders can be set or unset globally as a fallback. This will take precedence over a globally set `DOKKU_CNB_STACK` environment variable (`heroku/buildpacks` by default).
|
||||
|
||||
```shell
|
||||
# set globally
|
||||
dokku buildpacks:set-property --global stack paketobuildpacks/build:base-cnb
|
||||
|
||||
# unset globally
|
||||
dokku buildpacks:set-property --global stack
|
||||
```
|
||||
@@ -6,12 +6,20 @@ While Dokku normally defaults to using [Heroku buildpacks](https://devcenter.her
|
||||
|
||||
> Dockerfile support is considered a *power user* feature. By using Dockerfile-based deployment, you agree that you will not have the same comfort as that enjoyed by buildpack users, and Dokku features may work differently. Differences between the two systems will be documented here.
|
||||
|
||||
To use a Dockerfile for deployment, commit a valid `Dockerfile` to the root of your repository and push the repository to your Dokku installation. If this file is detected, Dokku will default to using it to construct containers *except* in the following two cases:
|
||||
## Usage
|
||||
|
||||
- The application has a `BUILDPACK_URL` environment variable set via the `dokku config:set` command or in a committed `.env` file. In this case, Dokku will use your specified buildpack.
|
||||
- The application has a `.buildpacks` file in the root of the repository. In this case, Dokku will use your specified buildpack(s).
|
||||
### Detection
|
||||
|
||||
## Switching from buildpack deployments
|
||||
This builder will be auto-detected in the following case:
|
||||
|
||||
- A `Dockerfile` exists in the root of the app repository.
|
||||
|
||||
Dokku will only select the `dockerfile` builder if both the `herokuish` and `pack` builders are not detected and a Dockerfile exists. For more information on how those are detected, see the following links:
|
||||
|
||||
- [Cloud Native Buildpacks documentation](/docs/deployment/builders/cloud-native-buildpacks.md#detection)
|
||||
- [Herokuish documentation](/docs/deployment/builders/herokuish-buildpacks.md#detection)
|
||||
|
||||
### Switching from buildpack deployments
|
||||
|
||||
If an application was previously deployed via buildpacks, the following commands should be run before a Dockerfile deploy will succeed:
|
||||
|
||||
@@ -19,7 +27,7 @@ If an application was previously deployed via buildpacks, the following commands
|
||||
dokku config:unset --no-restart node-js-app DOKKU_PROXY_PORT_MAP
|
||||
```
|
||||
|
||||
## Build-time configuration variables
|
||||
### Build-time configuration variables
|
||||
|
||||
For security reasons - and as per [Docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available only during runtime.
|
||||
|
||||
@@ -65,11 +73,11 @@ ENV NODE_ENV ${NODE_ENV}
|
||||
RUN echo $NODE_ENV
|
||||
```
|
||||
|
||||
## Building images with Docker Buildkit
|
||||
### Building images with Docker Buildkit
|
||||
|
||||
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. One way to do this is to edit `/etc/environment` on your dokku host and reboot your instance. Note, for complete build log output, you should also set `BUILDKIT_PROGRESS=plain` in the same file.
|
||||
|
||||
## Customizing the run command
|
||||
### Customizing the run command
|
||||
|
||||
By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base Node.js image, with the following `ENTRYPOINT`:
|
||||
|
||||
@@ -118,6 +126,6 @@ started by running `docker run bin/run-worker.sh` (the actual `docker run` comma
|
||||
complex, but this is the basic idea). If you use an `ENTRYPOINT` in your `Dockerfile`, the lines
|
||||
in your `Procfile` will be passed as arguments to the `ENTRYPOINT` script instead of being executed.
|
||||
|
||||
## Exposed ports
|
||||
### Exposed ports
|
||||
|
||||
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.
|
||||
@@ -3,12 +3,13 @@
|
||||
> Subcommands new as of 0.15.0
|
||||
|
||||
```
|
||||
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary
|
||||
buildpacks:clear <app> # Clear all buildpacks set on the app
|
||||
buildpacks:list <app> # List all buildpacks for an app
|
||||
buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app
|
||||
buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps
|
||||
buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
|
||||
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary
|
||||
buildpacks:clear <app> # Clear all buildpacks set on the app
|
||||
buildpacks:list <app> # List all buildpacks for an app
|
||||
buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app
|
||||
buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps
|
||||
buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
|
||||
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
||||
```
|
||||
|
||||
> Warning: If using the `buildpacks` plugin, be sure to unset any `BUILDPACK_URL` and remove any such entries from a committed `.env` file. A specified `BUILDPACK_URL` will always override a `.buildpacks` file or the buildpacks plugin.
|
||||
@@ -24,6 +25,23 @@ This page will cover usage of the `buildpacks` plugin.
|
||||
|
||||
## Usage
|
||||
|
||||
### Detection
|
||||
|
||||
This builder will be auto-detected in either the following cases:
|
||||
|
||||
- The `BUILDPACK_URL` app environment variable is set.
|
||||
- This can be done via `dokku config:set` or via a committed `.env` file in the root of the repository. See the [environment variable documentation](/docs/configuration/environment-variables.md) for more details.
|
||||
- A `.buildpacks` file exists in the root of the app repository.
|
||||
- This can be via a committed `.buildpacks` file or managed via the `buildpacks` plugin commands.
|
||||
|
||||
The builder can also be specified via the `builder:set` command:
|
||||
|
||||
```shell
|
||||
dokku builder:set node-js-app selected herokuish
|
||||
```
|
||||
|
||||
> Dokku will only select the `dockerfile` builder if both the `herokuish` and `pack` builders are not detected and a Dockerfile exists. See the [dockerfile builder documentation](/docs/deployment/builders/dockerfiles.md) for more information on how that builder functions.
|
||||
|
||||
### Listing Buildpacks in Use
|
||||
|
||||
The `buildpacks:list` command can be used to show buildpacks that have been set for an app. This will omit any auto-detected buildpacks.
|
||||
@@ -123,6 +141,34 @@ The `buildpacks:clear` command can be used to clear all configured buildpacks fo
|
||||
dokku buildpacks:clear node-js-app
|
||||
```
|
||||
|
||||
### Customizing the Buildpack stack builder
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
The default stack builder in use by Herokuish buildpacks in Dokku is based on `gliderlabs/herokuish:latest`. Typically, this is installed via an OS package which pulls the requisite Docker image. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack gliderlabs/herokuish:latest
|
||||
```
|
||||
|
||||
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack
|
||||
```
|
||||
|
||||
A change in the stack builder value will execute the `post-stack-set` trigger.
|
||||
|
||||
Finally, stack builders can be set or unset globally as a fallback. This will take precedence over a globally set `DOKKU_IMAGE` environment variable (`gliderlabs/herokuish:latest` by default).
|
||||
|
||||
```shell
|
||||
# set globally
|
||||
dokku buildpacks:set-property --global stack gliderlabs/herokuish:latest
|
||||
|
||||
# unset globally
|
||||
dokku buildpacks:set-property --global stack
|
||||
```
|
||||
|
||||
### Displaying buildpack reports for an app
|
||||
|
||||
You can get a report about the app's buildpacks status using the `buildpacks:report` command:
|
||||
@@ -133,11 +179,20 @@ dokku buildpacks:report
|
||||
|
||||
```
|
||||
=====> node-js-app buildpacks information
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
|
||||
Buildpacks stack: gliderlabs/herokuish:v0.5.23-20
|
||||
=====> python-sample buildpacks information
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git
|
||||
Buildpacks stack:
|
||||
=====> ruby-sample buildpacks information
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list:
|
||||
Buildpacks stack:
|
||||
```
|
||||
|
||||
You can run the command for a specific app also.
|
||||
@@ -187,7 +242,7 @@ dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-node
|
||||
|
||||
### Specifying commands via Procfile
|
||||
|
||||
While many buildpacks have a default command that is run when a detected repository is pushed, it is possible to override this command via a Procfile. A Procfile can also be used to specify multiple commands, each of which is subject to process scaling. See the [process scaling documentation](/docs/deployment/process-management.md) for more details around scaling individual processes.
|
||||
While many buildpacks have a default command that is run when a detected repository is pushed, it is possible to override this command via a Procfile. A Procfile can also be used to specify multiple commands, each of which is subject to process scaling. See the [process scaling documentation](/docs/processes/process-management.md) for more details around scaling individual processes.
|
||||
|
||||
A Procfile is a file named `Procfile`. It should be named `Procfile` exactly, and not anything else. For example, `Procfile.txt` is not valid. The file should be a simple text file.
|
||||
|
||||
@@ -208,7 +263,7 @@ worker: env QUEUE=* bundle exec rake resque:work
|
||||
importantworker: env QUEUE=important bundle exec rake resque:work
|
||||
```
|
||||
|
||||
The `web` process type holds some significance in that it is the only process type that is automatically scaled to `1` on the initial application deploy. See the [process scaling documentation](/docs/deployment/process-management.md) for more details around scaling individual processes.
|
||||
The `web` process type holds some significance in that it is the only process type that is automatically scaled to `1` on the initial application deploy. See the [process scaling documentation](/docs/processes/process-management.md) for more details around scaling individual processes.
|
||||
|
||||
|
||||
### `curl` build timeouts
|
||||
@@ -1,13 +1,13 @@
|
||||
# Log Management
|
||||
|
||||
```
|
||||
logs <app> [-h] [-t] [-n num] [-q] [-p process] # Display recent log output
|
||||
logs:failed [--all|<app>] # Shows the last failed deploy logs
|
||||
logs:report [<app>] [<flag>] # Displays a logs report for one or more apps
|
||||
logs:set [--global|<app>] <key> <value> # Set or clear a logs property for an app
|
||||
logs:vector-logs [--num num] [--tail] # Display vector log output
|
||||
logs:vector-start # Start the vector logging container
|
||||
logs:vector-stop # Stop the vector logging container
|
||||
logs <app> [-h] [-t|--tail] [-n|--num num] [-q|--quiet] [-p|--ps process] # Display recent log output
|
||||
logs:failed [--all|<app>] # Shows the last failed deploy logs
|
||||
logs:report [<app>] [<flag>] # Displays a logs report for one or more apps
|
||||
logs:set [--global|<app>] <key> <value> # Set or clear a logs property for an app
|
||||
logs:vector-logs [--num num] [--tail] # Display vector log output
|
||||
logs:vector-start # Start the vector logging container
|
||||
logs:vector-stop # Stop the vector logging container
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -57,6 +57,34 @@ You may also fetch all failed app logs by using the `--all` flag.
|
||||
dokku logs:failed --all
|
||||
```
|
||||
|
||||
### Docker Log Retention
|
||||
|
||||
Docker log retention can be specified via the `logs:set` command by specifying a value for `max-size`. Log retention is set via injected docker options for all applications, but is also available via the `logs-get-property` trigger for alternative schedulers.
|
||||
|
||||
```shell
|
||||
dokku logs:set node-js-app max-size 20m
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
```shell
|
||||
dokku logs:set node-js-app max-size
|
||||
```
|
||||
|
||||
Valid values include any integer number followed by a unit of measure (`k`, `m`, or `g`) or the string `unlimited`. Setting to `unlimited` will result in Dokku omitting the log option.
|
||||
|
||||
The `max-size` property can also be set globally. The global default is `10m`, and the global value is used when no app-specific value is set.
|
||||
|
||||
```shell
|
||||
dokku logs:set --global max-size 20m
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option.
|
||||
|
||||
```shell
|
||||
dokku logs:set --global max-size
|
||||
```
|
||||
|
||||
### Vector Logging Shipping
|
||||
|
||||
> New as of 0.22.6
|
||||
@@ -106,7 +134,7 @@ Vector uses the concept of log "sinks" to send logs to a given endpoint. Log sin
|
||||
```shell
|
||||
# setting the sink value in quotes is encouraged to avoid
|
||||
# issues with ampersand encoding in shell commands
|
||||
dokku logs:set node-js-app sink "console://?encoding[codec]=json"
|
||||
dokku logs:set node-js-app vector-sink "console://?encoding[codec]=json"
|
||||
```
|
||||
|
||||
A sink may be removed by setting an empty value, which will also reload the running vector container.
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Cloud Native Buildpacks (Experimental)
|
||||
|
||||
> New as of 0.22.0
|
||||
|
||||
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish.md) for more information on how to clear buildpack build cache for an application.
|
||||
|
||||
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this builder instead of either `Dockerfile` or `herokuish`, you must set the `DOKKU_CNB_EXPERIMENTAL` environment variable for your app to `1`.
|
||||
|
||||
```shell
|
||||
dokku config:set --no-restart node-js-app DOKKU_CNB_EXPERIMENTAL=1
|
||||
```
|
||||
|
||||
The `pack` cli tool is not included by default with Dokku or as a dependency. It must also be installed as shown on [this page](https://buildpacks.io/docs/tools/pack/).
|
||||
|
||||
Builds will proceed with the `pack` cli for the app from then on.
|
||||
|
||||
## Caveats
|
||||
|
||||
As this functionality is highly experimental, there are a number of caveats. Please note that not all issuesare listed below.
|
||||
|
||||
- The `heroku/buildpacks:latest` CNB builder is currently enforced. Specifying specific builders is not currently possible.
|
||||
- A future release will allow modifying the chosen builder.
|
||||
- Specifying specific buildpacks is not currently possible.
|
||||
- A future release will add support for the `buildpacks` plugin.
|
||||
- There is currently no way to specify extra arguments for `pack` cli invocations.
|
||||
- A future release will add support for injecting extra arguments during the build process.
|
||||
- The default process type is `web`.
|
||||
- Build cache is stored in Docker volumes instead of on disk. As such, `repo:purge-cache` currently has no effect.
|
||||
- A future version will add integration with the `repo` plugin.
|
||||
- `pack` is not currently included with Dokku, nor is it added as a package dependency.
|
||||
- A future version will include it as a package dependency.
|
||||
@@ -3,19 +3,28 @@
|
||||
> Subcommands new as of 0.12.0
|
||||
|
||||
```
|
||||
git:initialize <app> # Initialize a git repository for an app
|
||||
git:report [<app>] [<flag>] # Displays a git report for one or more apps
|
||||
git:set <app> <key> (<value>) # Set or clear a git property for an app
|
||||
git:allow-host <host> # Adds a host to known_hosts
|
||||
git:auth <host> [<username> <password>] # Configures netrc authentication for a given git server
|
||||
git:from-archive [--archive-type ARCHIVE_TYPE] <app> <archive-url> [<git-username> <git-email>] # Updates an app's git repository with a given archive file
|
||||
git:from-image [--build-dir DIRECTORY] <app> <docker-image> [<git-username> <git-email>] # Updates an app's git repository with a given docker image
|
||||
git:sync [--build] <app> <repository> [<git-ref>] # Clone or fetch an app from remote git repo
|
||||
git:initialize <app> # Initialize a git repository for an app
|
||||
git:public-key # Outputs the dokku public deploy key
|
||||
git:report [<app>] [<flag>] # Displays a git report for one or more apps
|
||||
git:set <app> <key> (<value>) # Set or clear a git property for an app
|
||||
git:unlock <app> [--force] # Removes previous git clone folder for new deployment
|
||||
```
|
||||
|
||||
Git-based deployment has been the traditional method of deploying applications in Dokku. As of v0.12.0, Dokku introduces a few ways to customize the experience of deploying via `git push`. A Git-based deployment currently supports building applications via:
|
||||
|
||||
- [Cloud Native Buildpacks](/docs/deployment/methods/cloud-native-buildpacks.md)
|
||||
- [Herokuish Buildpack](/docs/deployment/methods/herokuish-buildpacks.md)
|
||||
- [Dockerfiles](/docs/deployment/methods/dockerfiles.md)
|
||||
- [Cloud Native Buildpacks](/docs/deployment/builders/cloud-native-buildpacks.md)
|
||||
- [Herokuish Buildpack](/docs/deployment/builders/herokuish-buildpacks.md)
|
||||
- [Dockerfiles](/docs/deployment/builders/dockerfiles.md)
|
||||
|
||||
## Usage
|
||||
|
||||
> Warning: Pushing from a shallow clone is not currently supported and may have undefined behavior. Please unshallow your local repository before pushing to a Dokku app to avoid potential errors in the deployment process.
|
||||
|
||||
### Initializing an application
|
||||
|
||||
When an application is created via `git push`, Dokku will create the proper `pre-receive` hook in order to execute the build pipeline. In certain cases - such as when fronting deploys with the [`git-http-backend`](https://git-scm.com/docs/git-http-backend) - this may not be correctly created. As an alternative, the `git:initialize` command can be used to trigger this creation:
|
||||
@@ -55,6 +64,8 @@ dokku git:set --global deploy-branch SOME_BRANCH_NAME
|
||||
dokku git:set node-js-app deploy-branch SOME_BRANCH_NAME
|
||||
```
|
||||
|
||||
As of 0.22.1, Dokku will also respect the first pushed branch as the primary branch, and automatically set the `deploy-branch` value at that time.
|
||||
|
||||
Pushing multiple branches can also be supported by creating a [receive-branch](/docs/development/plugin-triggers.md#receive-branch) plugin trigger in a custom plugin.
|
||||
|
||||
### Configuring the `GIT_REV` environment variable
|
||||
@@ -105,3 +116,141 @@ dokku git:set node-js-app keep-git-dir false
|
||||
# delete the .git directory during builds (default)
|
||||
dokku git:set node-js-app keep-git-dir ""
|
||||
```
|
||||
|
||||
Please keep in mind that setting `keep-git-dir` to `true` may result in unstaged changes shown within the built container due to the build process generating application changes within the built app directory.
|
||||
|
||||
### Initializing an app repository from a docker image
|
||||
|
||||
> New as of 0.24.0
|
||||
|
||||
A Dokku app repository can be initialized or updated from a Docker image via the `git:from-image` command. This command will either initialize the app repository or update it to include the specified Docker image via a `FROM` stanza. This is an excellent way of tracking changes when deploying only a given docker image, especially if deploying an image from a remote CI/CD pipeline.
|
||||
|
||||
```shell
|
||||
dokku git:from-image node-js-app dokku/node-js-getting-started:latest
|
||||
```
|
||||
|
||||
In the above example, Dokku will build the app as if the repository contained _only_ a `Dockerfile` with the following content:
|
||||
|
||||
```Dockerfile
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
```shell
|
||||
dokku git:from-image node-js-app dokku/node-js-getting-started:latest "Camila" "camila@example.com"
|
||||
```
|
||||
|
||||
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
|
||||
dokku git:from-image --build-dir path/to/build node-js-app dokku/node-js-getting-started:latest "Camila" "camila@example.com"
|
||||
```
|
||||
|
||||
See the [dockerfile documentation](/docs/deployment/builders/dockerfiles.md) to learn about the different ways to configure Dockerfile-based deploys.
|
||||
|
||||
### Initializing an app repository from an archive file
|
||||
|
||||
> New as of 0.24.0
|
||||
|
||||
A Dokku app repository can be initialized or updated from the contents of an archive file via the `git:from-archive` command. This is an excellent way of tracking changes when deploying pre-built binary archives, such as java jars or go binaries. This can also be useful when deploying directly from a Github repository at a specific commit.
|
||||
|
||||
```shell
|
||||
dokku git:from-archive node-js-app https://github.com/dokku/smoke-test-app/releases/download/2.0.0/smoke-test-app.tar
|
||||
```
|
||||
|
||||
In the above example, Dokku will build the app as if the repository contained the extracted contents of the specified archive file.
|
||||
|
||||
Triggering a build with the same archive file multiple times will result in Dokku exiting `0` early as there will be no changes detected.
|
||||
|
||||
The `git:from-archive` 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.
|
||||
|
||||
```shell
|
||||
dokku git:from-archive node-js-app https://github.com/dokku/smoke-test-app/releases/download/2.0.0/smoke-test-app.tar "Camila" "camila@example.com"
|
||||
```
|
||||
|
||||
The default archive type is always set to `.tar`. To use a different archive type, specify the `--archive-type` flag. Failure to do so will result in a failure to extract the archive.
|
||||
|
||||
```shell
|
||||
dokku git:from-archive --archive-type zip node-js-app https://github.com/dokku/smoke-test-app/archive/2.0.0.zip "Camila" "camila@example.com"
|
||||
```
|
||||
|
||||
Finally, if the archive url is specified as `--`, the archive will be fetched from stdin.
|
||||
|
||||
```shell
|
||||
curl -sSL https://github.com/dokku/smoke-test-app/releases/download/2.0.0/smoke-test-app.tar | dokku git:from-archive node-js-app --
|
||||
```
|
||||
|
||||
### Initializing an app repository from a remote repository
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
A Dokku app repository can be initialized or updated from a remote git repository via the `git:sync` command. This command will either clone or fetch updates from a remote repository and has undefined behavior if the history cannot be fast-fowarded to the referenced repository reference. Any repository that can be cloned by the `dokku` user can be specified.
|
||||
|
||||
> The application must exist before the repository can be initialized
|
||||
|
||||
```shell
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git
|
||||
```
|
||||
|
||||
The `git:sync` command optionally takes an optional third parameter containing a git reference, which may be a branch, tag, or specific commit.
|
||||
|
||||
```shell
|
||||
# specify a branch
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git main
|
||||
|
||||
# specify a tag
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git 1
|
||||
|
||||
# specify a commit
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git 97e6c72491c7531507bfc5413903e0e00e31e1b0
|
||||
```
|
||||
|
||||
By default, this command does not trigger an application build. To do so during a `git:sync`, specify the `--build` flag.
|
||||
|
||||
```shell
|
||||
dokku git:sync --build node-js-app https://github.com/heroku/node-js-getting-started.git
|
||||
```
|
||||
|
||||
### Initializing from private repositories
|
||||
|
||||
> New as of 0.24.0
|
||||
|
||||
Initializing from a private repository requires one of the following:
|
||||
|
||||
- A Public SSH Key (`id_rsa.pub` file) configured on the remote server, with the associated private key (`id_rsa`) in the Dokku server's `/home/dokku/.ssh/` directory.
|
||||
- A configured [`.netrc`](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) entry.
|
||||
|
||||
Dokku provides the `git:auth` command which can be used to configure a `netrc` entry for the remote server. This command can be used to add or remove configuration for any remote server.
|
||||
|
||||
```shell
|
||||
# add credentials for github.com
|
||||
dokku git:auth github.com username personal-access-token
|
||||
|
||||
# remove credentials for github.com
|
||||
dokku git:auth github.com
|
||||
```
|
||||
|
||||
For syncing to a private repository stored on a remote Git product such as Github or Gitlab, Dokku's recommendation is to use a personal access token on a bot user where possible. Please see your service's documentation for information regarding the recommended best practices.
|
||||
|
||||
### Allowing remote repository hosts
|
||||
|
||||
By default, the Dokku host may not have access to a server containing the remote repository. This can be initialized via the `git:allow-host` command.
|
||||
|
||||
```shell
|
||||
dokku git:allow-host github.com
|
||||
```
|
||||
|
||||
Note that this command is currently not idempotent and may add duplicate entries to the `~dokku/.ssh/known_hosts` file.
|
||||
|
||||
### Verifying the cloning public key
|
||||
|
||||
In order to clone a remote repository, the remote server should have the Dokku host's public key configured. This plugin does not currently create this key, but if there is one available, it can be shown via the `git:public-key` command.
|
||||
|
||||
```shell
|
||||
dokku git:public-key
|
||||
```
|
||||
|
||||
If there is no key, an error message is shown that displays the command that can be run on the Dokku server to generate a new public/private ssh key pair.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Docker Image Tag Deployment
|
||||
|
||||
> Warning: As of 0.24.0, this functionality is deprecated in favor of the [`git:from-image`](/docs/deployment/methods/git.md#initializing-an-app-repository-from-a-docker-image) command. It will be removed in a future release, and is considered unmaintained. Users are highly encouraged to switch their workflows to `git:from-image`.
|
||||
>
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
@@ -78,7 +80,7 @@ dokku tags:deploy node-js-app v1
|
||||
-----> Deploying node-js-app (dokku/node-js-app:v1)...
|
||||
-----> Running pre-flight checks
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
@@ -168,4 +170,4 @@ ssh my.dokku.host "dokku tags:create test-app previous; dokku tags:deploy test-a
|
||||
## Related articles
|
||||
- [Setting up persistent storage](/docs/advanced-usage/persistent-storage.md)
|
||||
- [Defining environment variables](/docs/configuration/environment-variables.md)
|
||||
- [Setting up the ports](/docs/advanced-usage/proxy-management.md)
|
||||
- [Setting up the ports](/docs/networking/proxy-management.md)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 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`.
|
||||
>
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
# One-off Processes and Cron
|
||||
|
||||
Sometimes you need to either inspect running containers or run a one-off command under an application. In those cases, Dokku makes it easy to either connect to a running container or run a fresh container.
|
||||
|
||||
## Run a command in an app environment
|
||||
|
||||
```
|
||||
run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
|
||||
```
|
||||
|
||||
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
||||
|
||||
```shell
|
||||
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
||||
dokku run node-js-app ls -lah
|
||||
|
||||
# optionally, run can be passed custom environment variables
|
||||
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
|
||||
```
|
||||
|
||||
The `run` command can also be used to run a command defined in your Procfile:
|
||||
|
||||
```
|
||||
console: bundle exec racksh
|
||||
```
|
||||
|
||||
```shell
|
||||
# runs `bundle exec racksh` in the `/app` directory of the application `my-app`
|
||||
dokku run my-app console
|
||||
```
|
||||
|
||||
If you want to remove the container after a command has started, you can run the following command:
|
||||
|
||||
```shell
|
||||
# don't keep `run` containers around
|
||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||
|
||||
# revert the above setting and keep containers around
|
||||
dokku config:unset --global DOKKU_RM_CONTAINER
|
||||
```
|
||||
|
||||
You may also use the `--rm-container` or `--rm` Dokku flags to remove the containers automatically:
|
||||
|
||||
```shell
|
||||
dokku --rm-container run node-js-app ls -lah
|
||||
dokku --rm run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Containers may have specific labels attached. In order to avoid issues with dokku internals, do not use any labels beginning with either `com.dokku` or `org.label-schema`.
|
||||
|
||||
```shell
|
||||
dokku --label=com.example.test-label=value run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Finally, you may wish to run a container in "detached" mode via the `--detach` Dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as Dokku will *not* automatically terminate the container.
|
||||
|
||||
```shell
|
||||
dokku --detach run node-js-app ls -lah
|
||||
# returns the ID of the new container
|
||||
```
|
||||
|
||||
> Note that you may not use the `--rm-container` or `--rm` flags when running containers in detached mode, and attempting to do so will result in the `--detach` flag being ignored.
|
||||
|
||||
### Using `run` for cron tasks
|
||||
|
||||
You can always use a one-off container to run an application task:
|
||||
|
||||
```shell
|
||||
dokku --rm run node-js-app some-command
|
||||
dokku --rm-container run node-js-app some-command
|
||||
```
|
||||
|
||||
For tasks that should not be interrupted, run is the *preferred* method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
|
||||
|
||||
## Entering existing containers
|
||||
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
enter <app> [<container-type> || --container-id <container-id>] # Connect to a specific app container
|
||||
```
|
||||
|
||||
The `enter` command can be used to enter a running container. The following variations of the command exist:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app web
|
||||
dokku enter node-js-app web.1
|
||||
dokku enter node-js-app --container-id ID
|
||||
```
|
||||
|
||||
Additionally, you can run `enter` with no `<container-type>`. If only a single `<container-type>` is defined in your app, you will be dropped 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:
|
||||
|
||||
```shell
|
||||
# just echo hi
|
||||
dokku enter node-js-app web echo hi
|
||||
|
||||
# run a long-running command, as one might for a cron task
|
||||
dokku enter node-js-app web python script/background-worker.py
|
||||
```
|
||||
|
||||
### Using `enter` for cron tasks
|
||||
|
||||
Your Procfile can have the following entry:
|
||||
|
||||
```Procfile
|
||||
cron: sleep infinity
|
||||
```
|
||||
|
||||
With the `cron` process scaled to `1`:
|
||||
|
||||
```shell
|
||||
dokku ps:scale node-js-app cron=1
|
||||
```
|
||||
|
||||
You can now run all your commands in that container:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app cron some-command
|
||||
```
|
||||
|
||||
Note that you can also run multiple commands at the same time to reduce memory usage, though that may result in polluting the container environment.
|
||||
|
||||
For tasks that will properly resume, you *should* use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
|
||||
|
||||
## General cron recommendations
|
||||
|
||||
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
|
||||
|
||||
- Use the `dokku` user's crontab.
|
||||
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
|
||||
- Add a `MAILTO` environment variable to ship cron emails to yourself.
|
||||
- Add a `PATH` environment variable or specify the full path to binaries on the host.
|
||||
- Add a `SHELL` environment variable to specify Bash when running commands.
|
||||
- Keep your cron tasks in time-sorted order.
|
||||
- Keep your server time in UTC so you don't need to translate daylight savings time when reading the cronfile.
|
||||
- Run tasks at the lowest traffic times if possible.
|
||||
- Use cron to *trigger* jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
|
||||
- Try to keep tasks quiet so that mails only send on errors.
|
||||
- Do not silence standard error or standard out. If you silence the former, you will miss failures. Silencing the latter means you should actually make application changes to handle log levels.
|
||||
- Use a service such as [Dead Man's Snitch](https://deadmanssnitch.com) to verify that cron tasks completed successfully.
|
||||
- Add lots of comments to your cronfile, including what a task is doing, so that you don't spend time deciphering the file later.
|
||||
- Place your cronfiles in a pattern such as `/etc/cron.d/APP`.
|
||||
- Do not use non-ASCII characters in your cronfile names. cron is finicky.
|
||||
- Remember to have trailing newlines in your cronfile! cron is finicky.
|
||||
|
||||
The following is a sample cronfile that you can use for your applications:
|
||||
|
||||
```cron
|
||||
# server cron jobs
|
||||
MAILTO="mail@dokku.me"
|
||||
PATH=/usr/local/bin:/usr/bin:/bin
|
||||
SHELL=/bin/bash
|
||||
|
||||
# m h dom mon dow username command
|
||||
# * * * * * dokku command to be executed
|
||||
# - - - - -
|
||||
# | | | | |
|
||||
# | | | | +----- day of week (0 - 6) (Sunday=0)
|
||||
# | | | +------- month (1 - 12)
|
||||
# | | +--------- day of month (1 - 31)
|
||||
# | +----------- hour (0 - 23)
|
||||
# +----------- min (0 - 59)
|
||||
|
||||
### HIGH TRAFFIC TIME IS B/W 00:00 - 04:00 AND 14:00 - 23:59
|
||||
### RUN YOUR TASKS FROM 04:00 - 14:00
|
||||
### KEEP SORTED IN TIME ORDER
|
||||
|
||||
### PLACE ALL CRON TASKS BELOW
|
||||
|
||||
# removes unresponsive users from the subscriber list to decrease bounce rates
|
||||
0 0 * * * dokku dokku --rm run node-js-app some-command
|
||||
|
||||
# sends out our email alerts to users
|
||||
0 1 * * * dokku dokku ps:scale node-js-app cron=1 && dokku enter node-js-app cron some-other-command && dokku ps:scale node-js-app cron=0
|
||||
|
||||
### PLACE ALL CRON TASKS ABOVE, DO NOT REMOVE THE WHITESPACE AFTER THIS LINE
|
||||
|
||||
```
|
||||
@@ -217,19 +217,19 @@ dokku checks:run APP
|
||||
-----> Running pre-flight checks
|
||||
-----> Running checks for app (APP.web.1)
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
-----> Running checks for app (APP.web.2)
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
-----> Running checks for app (APP.worker.1)
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
@@ -245,7 +245,7 @@ dokku checks:run node-js-app worker
|
||||
-----> Running pre-flight checks
|
||||
-----> Running checks for app (APP.worker.1)
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
@@ -261,7 +261,7 @@ dokku checks:run node-js-app web.2
|
||||
-----> Running pre-flight checks
|
||||
-----> Running checks for app (APP.web.2)
|
||||
For more efficient zero downtime deployments, create a file CHECKS.
|
||||
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
|
||||
See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
|
||||
CHECKS file not found in container: Running simple container check...
|
||||
-----> Waiting for 10 seconds ...
|
||||
-----> Default container check successful!
|
||||
|
||||
@@ -143,6 +143,24 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `builder-detect`
|
||||
|
||||
- Description: Allows overriding the auto-detected `herokuish` builder in favor of a custom one. Dockerfile gets lowest builder precedence.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; SOURCECODE_WORK_DIR="$2"
|
||||
|
||||
if [[ -f "$SOURCECODE_WORK_DIR/project.toml" ]]; then
|
||||
echo -n "pack"
|
||||
fi
|
||||
```
|
||||
|
||||
### `builder-create-dokku-image`
|
||||
|
||||
- Description: Allows modification of the configured dokku-image
|
||||
@@ -261,6 +279,21 @@ help_content
|
||||
esac
|
||||
```
|
||||
|
||||
### `config-export`
|
||||
|
||||
- Description: Returns the environment variables in a specified format
|
||||
- Invoked by: app-json plugin
|
||||
- Arguments: `$APP $GLOBAL $MERGED $FORMAT`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `config-get`
|
||||
|
||||
- Description: Fetches the app config value for a key
|
||||
@@ -309,6 +342,40 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
curl "http://httpstat.us/200"
|
||||
```
|
||||
|
||||
### `cron-write`
|
||||
|
||||
- Description: Force triggers writing out cron entries
|
||||
- Invoked by:
|
||||
- Arguments:
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `cron-entries`
|
||||
|
||||
- Description: Allows injecting cron entries into the written out scheduled cron task list. Each entry is newline delimited, and individual entries come in the form `$SCHEDULE;$FULL_COMMAND;$ARBITRARY_DATA`. Individual implementations of cron writing can decide whether and how to include these cron entries. The `ARBITRARY_DATA` includes the log file path for the basic `docker-local` cron implementation.
|
||||
- Invoked by:
|
||||
- Arguments: `$DOKKU_SCHEDULER`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
DOKKU_SCHEDULER="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `dependencies`
|
||||
|
||||
- Description: Used to install system-level dependencies.
|
||||
@@ -327,7 +394,7 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
apt-get install -qq -y nginx
|
||||
apt-get -qq -y --no-install-recommends install nginx
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
@@ -699,6 +766,22 @@ if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
fi
|
||||
```
|
||||
|
||||
### `logs-get-property`
|
||||
|
||||
- Description: Fetches a given logs property value
|
||||
- Invoked by:
|
||||
- Arguments: `$APP` `$PROPERTY`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; PROPERTY="$2"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `network-build-config`
|
||||
|
||||
- Description: Rebuilds network configuration
|
||||
@@ -1010,12 +1093,12 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-build-cnb`
|
||||
### `post-build-pack`
|
||||
|
||||
> Warning: The cnb plugin trigger apis are under development and may change
|
||||
> Warning: The pack plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to apps using cnb.
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to apps using pack.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
||||
- Example:
|
||||
@@ -1201,7 +1284,7 @@ REV="$3" # optional, may not be sent for tar-based builds
|
||||
pushd "$TMP_WORK_DIR" >/dev/null
|
||||
touch Procfile
|
||||
echo "clock: some-command" >> Procfile
|
||||
popd >/dev/null
|
||||
popd &>/dev/null
|
||||
```
|
||||
|
||||
### `post-proxy-ports-update`
|
||||
@@ -1243,14 +1326,14 @@ APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-release-cnb`
|
||||
### `post-release-pack`
|
||||
|
||||
> Warning: The cnb plugin trigger apis are under development and may change
|
||||
> Warning: The pack plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
> Warning: Image mutation in this trigger may result in an invalid run state, and is heavily discouraged.
|
||||
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to apps using cnb.
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to apps using pack.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
@@ -1317,12 +1400,12 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-build-cnb`
|
||||
### `pre-build-pack`
|
||||
|
||||
> Warning: The cnb plugin trigger apis are under development and may change
|
||||
> Warning: The pack plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using cnb.
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using pack.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
||||
- Example:
|
||||
@@ -1465,7 +1548,7 @@ dokku_log_info1 "Installing GraphicsMagick..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s graphicsmagick >/dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
|
||||
(apt-get update -qq && apt-get -qq -y --no-install-recommends install graphicsmagick && apt-get clean)"
|
||||
|
||||
CID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $CID) -eq 0
|
||||
@@ -1474,12 +1557,12 @@ docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null
|
||||
```
|
||||
|
||||
|
||||
### `pre-release-cnb`
|
||||
### `pre-release-pack`
|
||||
|
||||
> Warning: The cnb plugin trigger apis are under development and may change
|
||||
> Warning: The pack plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to apps using cnb.
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to apps using pack.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
@@ -1882,25 +1965,6 @@ DOKKU_SCHEDULER="$1"; APP="$2";
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-is-deployed`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to check if an app has been deployed
|
||||
- Invoked by: `dokku ps:rebuild`
|
||||
- Arguments: `$DOKKU_SCHEDULER $APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
DOKKU_SCHEDULER="$1"; APP="$2";
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-logs`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
@@ -2092,6 +2156,21 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_REPO="$3"; IMAGE_TAG="$4";
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `storage-list`
|
||||
|
||||
- Description: Returns a list of storage mounts
|
||||
- Invoked by: `dokku storage:list` and `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
### `tags-create`
|
||||
|
||||
- Description: Allows you to run commands once a tag for an app image has been added
|
||||
|
||||
@@ -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.22.8-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.24.2-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'
|
||||
|
||||
@@ -5,7 +5,7 @@ As of 0.3.18, Dokku defaults to being installed via Debian package. While certai
|
||||
```shell
|
||||
# install prerequisites
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y apt-transport-https
|
||||
sudo apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
# install docker
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
@@ -16,7 +16,7 @@ OS_ID="$(lsb_release -cs 2>/dev/null || echo "bionic")"
|
||||
echo "xenial bionic focal" | grep -q "$OS_ID" || OS_ID="bionic"
|
||||
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y dokku
|
||||
sudo apt-get -qq -y install dokku
|
||||
sudo dokku plugin:install-dependencies --core
|
||||
```
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# DigitalOcean Droplet Installation Notes
|
||||
|
||||
[DigitalOcean](https://www.digitalocean.com/products/compute/) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
|
||||
[DigitalOcean](https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
|
||||
|
||||
> **Please disable IPv6**. There are known issues with IPv6 on DigitalOcean and Docker. If you would like to run Dokku on an IPv6 DigitalOcean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/).
|
||||
|
||||
1. Login to your [DigitalOcean](https://m.do.co/c/fe06b043a083) account.
|
||||
2. Click **Create a Droplet**.
|
||||
3. Under **Choose an image > One-click apps**, choose the latest **Dokku** release for 18.04 _(version numbers may vary)_.
|
||||
3. Under **Choose an image > Marketplace**, search latest **Dokku** release for Ubuntu 20.04 _(version numbers may vary)_.
|
||||
4. Under **Choose a size**, select your machine spec.
|
||||
5. Under **Choose a datacenter region**, select your region.
|
||||
6. Add an SSH Key.
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
Pull the dokku/dokku image:
|
||||
|
||||
```shell
|
||||
docker pull dokku/dokku:0.22.8
|
||||
docker pull dokku/dokku:0.24.2
|
||||
```
|
||||
|
||||
Next, run the image.
|
||||
|
||||
```shell
|
||||
docker run \
|
||||
docker container run \
|
||||
--env DOKKU_HOSTNAME=dokku.me \
|
||||
--name dokku \
|
||||
--publish 3022:22 \
|
||||
@@ -17,7 +17,7 @@ docker run \
|
||||
--publish 8443:443 \
|
||||
--volume /var/lib/dokku:/mnt/dokku \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
dokku/dokku:0.22.8
|
||||
dokku/dokku:0.24.2
|
||||
```
|
||||
|
||||
Dokku is run in the following configuration:
|
||||
@@ -31,7 +31,11 @@ Dokku is run in the following configuration:
|
||||
- The docker socket is mounted into container
|
||||
- The "web installer" is not supported.
|
||||
|
||||
Application repositories, plugin config, and plugin data is persisted to disk within the specified host directory for `/var/lib/dokku`.
|
||||
Application repositories, plugin config, as well as plugin data are persisted to disk within the specified host directory for `/var/lib/dokku`.
|
||||
|
||||
Other docker container options can also be used when running Dokku, though the specific outcome will depend upon the specified options. For example, the Dokku container's nginx port can be bound to a specific host ip by specifying `--publish $HOST_IP:8080:80`, where `$HOST_IP` is the IP desired. Please see the [docker container run documentation](https://docs.docker.com/engine/reference/commandline/run/) for further explanation for various docker arguments.
|
||||
|
||||
## Plugin Installation
|
||||
|
||||
To install custom plugins, create a `plugin-list` file in the host's `/var/lib/dokku` directory. The plugins listed herein will be automatically installed by Dokku on container boot. This file should be the following format:
|
||||
|
||||
@@ -46,6 +50,8 @@ postgres: https://github.com/dokku/dokku-postgres.git
|
||||
redis: https://github.com/dokku/dokku-redis.git
|
||||
```
|
||||
|
||||
## SSH Key Management
|
||||
|
||||
To initialize ssh-keys within the container, use `docker exec` to enter the container and run the appropriate ssh-keys commands.
|
||||
|
||||
```shell
|
||||
@@ -53,3 +59,15 @@ docker exec -it dokku bash
|
||||
```
|
||||
|
||||
Please see the [user management documentation](/docs/deployment/user-management.md) for more information.
|
||||
|
||||
## Pushing Applications
|
||||
|
||||
When exposing the Dokku container's SSH port (22) on 3022, something similar to the following will need to be setup within the user's `~/.ssh/config`:
|
||||
|
||||
```
|
||||
Host dokku.docker
|
||||
HostName 127.0.0.1
|
||||
Port 3022
|
||||
```
|
||||
|
||||
In the above example, the hostname `127.0.0.1` is being aliased to `dokku.docker`, while the port is being overriden to `3022`. All SSH commands - including git pushes - for the hostname `dokku.docker` will be transparently sent to `127.0.0.1:3022`.
|
||||
|
||||
@@ -21,8 +21,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.22.8/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.22.8 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.24.2/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.24.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
|
||||
@@ -235,4 +235,4 @@ This isn't usually an issue with Dokku, but rather an app config problem. This c
|
||||
|
||||
In Rails at least, if your `application.rb` or `environmnents/production.rb` include the line `configure.force_ssl = true` which includes HSTS, try commenting that out and redeploying.
|
||||
|
||||
If this solves the issue temporarily, longer term you should consider [configuring SSL](http://dokku.viewdocs.io/dokku/configuration/ssl/).
|
||||
If this solves the issue temporarily, longer term you should consider [configuring SSL](/docs/configuration/ssl.md).
|
||||
|
||||
@@ -19,6 +19,8 @@ Docker releases updates periodically to their engine. We recommend reading their
|
||||
|
||||
Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded.
|
||||
|
||||
- [Upgrading to 0.24](/docs/appendices/0.24.0-migration-guide.md)
|
||||
- [Upgrading to 0.23](/docs/appendices/0.23.0-migration-guide.md)
|
||||
- [Upgrading to 0.22](/docs/appendices/0.22.0-migration-guide.md)
|
||||
- [Upgrading to 0.21](/docs/appendices/0.21.0-migration-guide.md)
|
||||
- [Upgrading to 0.20](/docs/appendices/0.20.0-migration-guide.md)
|
||||
@@ -89,17 +91,17 @@ When installing from source, this is available from `contrib/dokku-update`, and
|
||||
|
||||
## Upgrading using `apt`
|
||||
|
||||
If Dokku was installed in a Debian or Ubuntu system, via `apt install dokku` or `bootstrap.sh`, you can upgrade with `apt`:
|
||||
If Dokku was installed in a Debian or Ubuntu system, via `apt-get install dokku` or `bootstrap.sh`, you can upgrade with `apt-get`:
|
||||
|
||||
```shell
|
||||
# update your local apt cache
|
||||
sudo apt update
|
||||
sudo apt-get update -qq
|
||||
|
||||
# update dokku and its dependencies
|
||||
sudo apt install -qq -y dokku herokuish sshcommand plugn gliderlabs-sigil
|
||||
sudo apt-get -qq -y --no-install-recommends install dokku herokuish sshcommand plugn gliderlabs-sigil dokku-update dokku-event-listener
|
||||
|
||||
# or just upgrade every package:
|
||||
sudo apt upgrade
|
||||
sudo apt-get upgrade
|
||||
```
|
||||
|
||||
## Upgrading from source
|
||||
|
||||
@@ -4,7 +4,7 @@ If you’re stuck, there are a number of places you can get help:
|
||||
|
||||
## The Official Dokku Website
|
||||
|
||||
- [http://dokku.viewdocs.io/dokku/](/docs/)
|
||||
- [https://dokku.com/docs/](/docs/)
|
||||
|
||||
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using Dokku.
|
||||
|
||||
|
||||
@@ -10,61 +10,32 @@
|
||||
<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.22.8/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.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.24.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/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.22.8/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/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.22.8/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
.sponsors {
|
||||
background-color: #272822;
|
||||
color: #FCFCFC;
|
||||
}
|
||||
.sponsors a {
|
||||
color: #f0ad4e;
|
||||
}
|
||||
.sponsors .backer img,
|
||||
.sponsors .sponsor img {
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
border: 8px solid gray;
|
||||
margin: 20px auto 20px auto;
|
||||
max-width: 192px;
|
||||
}
|
||||
.sponsors .backer img {
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
border: 0;
|
||||
}
|
||||
.sponsors img:hover {
|
||||
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
|
||||
-webkit-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
|
||||
box-shadow: 0px 0px 32px 0px rgba(0,0,0,0.75);
|
||||
}
|
||||
.sponsors .fund-link {
|
||||
display: block;
|
||||
font-size: .8em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -130,12 +101,12 @@
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.8/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.24.2/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.22.8 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.24.2 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
@@ -215,7 +186,7 @@
|
||||
</div>
|
||||
|
||||
<div class="alternate-instructions">
|
||||
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://www.digitalocean.com/features/one-click-apps/dokku/" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
|
||||
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
|
||||
<p>Still no love? <a href="https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md" target="_blank">Contributions welcome</a>!</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -136,7 +136,7 @@ For buildpack deployments, your application *must* respect the `PORT` environmen
|
||||
|
||||
> Changed as of 0.5.0
|
||||
|
||||
Dokku's default proxy implementation - nginx - supports HTTP and GRPC request proxying. At this time, we do not support proxying plain TCP or UDP ports. UDP ports can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`. If you would like to investigate alternative proxy methods, please refer to our [proxy management documentation](/docs/advanced-usage/proxy-management.md).
|
||||
Dokku's default proxy implementation - nginx - supports HTTP and GRPC request proxying. At this time, we do not support proxying plain TCP or UDP ports. UDP ports can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`. If you would like to investigate alternative proxy methods, please refer to our [proxy management documentation](/docs/networking/proxy-management.md).
|
||||
|
||||
#### Applications using EXPOSE
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
> New as of 0.5.0, Enhanced in 0.6.0
|
||||
|
||||
```
|
||||
proxy:build-config <app> # (Re)builds config for given app
|
||||
proxy:disable <app> # Disable proxy for app
|
||||
proxy:enable <app> # Enable proxy for app
|
||||
proxy:report [<app>] [<flag>] # Displays a proxy report for one or more apps
|
||||
proxy:set <app> <proxy-type> # Set proxy type for app
|
||||
proxy:build-config [--parallel count] [--all|<app>] # (Re)builds config for given app
|
||||
proxy:disable [--parallel count] [--all|<app>] # Disable proxy for app
|
||||
proxy:enable [--parallel count] [--all|<app>] # Enable proxy for app
|
||||
proxy:report [<app>] [<flag>] # Displays a proxy report for one or more apps
|
||||
proxy:set <app> <proxy-type> # Set proxy type for app
|
||||
```
|
||||
|
||||
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
|
||||
@@ -22,11 +22,23 @@ In certain cases, your app proxy configs may drift from the correct config for y
|
||||
dokku proxy:build-config node-js-app
|
||||
```
|
||||
|
||||
### Container network interface binding
|
||||
All apps may have their proxy config rebuilt by using the `--all` flag.
|
||||
|
||||
> Changed as of 0.11.0
|
||||
```shell
|
||||
dokku proxy:build-config --all
|
||||
```
|
||||
|
||||
From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.11.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information.
|
||||
By default, rebuilding proxy configs for all apps happens serially. The parallelism may be controlled by the `--parallel` flag.
|
||||
|
||||
```shell
|
||||
dokku proxy:build-config --all --parallel 2
|
||||
```
|
||||
|
||||
Finally, the number of parallel workers may be automatically set to the number of CPUs available by setting the `--parallel` flag to `-1`
|
||||
|
||||
```shell
|
||||
dokku proxy:build-config --all --parallel -1
|
||||
```
|
||||
|
||||
### Displaying proxy reports for an app
|
||||
|
||||
@@ -94,3 +106,9 @@ dokku proxy:set node-js-app nginx
|
||||
### Proxy port mapping
|
||||
|
||||
See the [port management documentation](/docs/networking/port-management.md) for more information on how port mappings are managed for an application.
|
||||
|
||||
### Container network interface binding
|
||||
|
||||
> Changed as of 0.11.0
|
||||
|
||||
From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.11.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information.
|
||||
|
||||
29
docs/processes/entering-containers.md
Normal file
29
docs/processes/entering-containers.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Entering containers
|
||||
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
enter <app> [<container-type> || --container-id <container-id>] # Connect to a specific app container
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The `enter` command can be used to enter a running container. The following variations of the command exist:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app web
|
||||
dokku enter node-js-app web.1
|
||||
dokku enter node-js-app --container-id ID
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```shell
|
||||
# just echo hi
|
||||
dokku enter node-js-app web echo hi
|
||||
|
||||
# run a long-running command, as one might for a cron task
|
||||
dokku enter node-js-app web python script/background-worker.py
|
||||
```
|
||||
62
docs/processes/one-off-tasks.md
Normal file
62
docs/processes/one-off-tasks.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# One-off Tasks
|
||||
|
||||
```
|
||||
run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
|
||||
```
|
||||
|
||||
Sometimes it is necessary to run a one-off command under an application. Dokku makes it easy to run a fresh container via the `run` command.
|
||||
|
||||
## Usage
|
||||
|
||||
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
||||
|
||||
```shell
|
||||
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
||||
dokku run node-js-app ls -lah
|
||||
|
||||
# optionally, run can be passed custom environment variables
|
||||
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
|
||||
```
|
||||
|
||||
The `run` command can also be used to run a command defined in the app `Procfile`:
|
||||
|
||||
```
|
||||
console: bundle exec racksh
|
||||
```
|
||||
|
||||
```shell
|
||||
# runs `bundle exec racksh` in the `/app` directory of the application `my-app`
|
||||
dokku run my-app console
|
||||
```
|
||||
|
||||
If the container running the command should be removed after exit, the `--rm-container` or `--rm` global flags can be specified to remove the containers automatically:
|
||||
|
||||
```shell
|
||||
dokku --rm-container run node-js-app ls -lah
|
||||
dokku --rm run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Alternatively, a global property can be set to always remove `run` containers.
|
||||
|
||||
```shell
|
||||
# don't keep `run` containers around
|
||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||
|
||||
# revert the above setting and keep containers around
|
||||
dokku config:unset --global DOKKU_RM_CONTAINER
|
||||
```
|
||||
|
||||
Containers may have specific labels attached. In order to avoid issues with dokku internals, do not use any labels beginning with either `com.dokku` or `org.label-schema`.
|
||||
|
||||
```shell
|
||||
dokku --label=com.example.test-label=value run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Finally, a container can be run in "detached" mode via the `--detach` Dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as Dokku will *not* automatically terminate the container.
|
||||
|
||||
```shell
|
||||
dokku --detach run node-js-app ls -lah
|
||||
# returns the ID of the new container
|
||||
```
|
||||
|
||||
> Note that the `--rm-container` or `--rm` flags cannot be used when running containers in detached mode, and attempting to do so will result in the `--detach` flag being ignored.
|
||||
@@ -1,4 +1,4 @@
|
||||
# Process and Container Management
|
||||
# Process Management
|
||||
|
||||
> New as of 0.3.14, Enhanced in 0.7.0
|
||||
|
||||
193
docs/processes/scheduled-cron-tasks.md
Normal file
193
docs/processes/scheduled-cron-tasks.md
Normal file
@@ -0,0 +1,193 @@
|
||||
# Scheduled Cron Tasks
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
```
|
||||
cron:list <app> # List scheduled cron tasks for an app
|
||||
cron:report [<app>] [<flag>] # Display report about an app
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Dokku Managed Cron
|
||||
|
||||
Dokku automates scheduled `dokku run` commands via it's `app.json` cron integration.
|
||||
|
||||
#### Specifying commands
|
||||
|
||||
The `app.json` file for a given app can define a special `cron` key that contains a list of commands to run on given schedules. The following is a simple example `app.json` that simply runs the command `true` once a day:
|
||||
|
||||
```
|
||||
{
|
||||
"cron": [
|
||||
{
|
||||
"command": "true",
|
||||
"schedule": "@daily"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
A cron entry takes the following properties:
|
||||
|
||||
- `command`: A command to be run within the built app image. Specified commands can also be `Procfile` entries.
|
||||
- `schedule`: A [cron-compatible](https://en.wikipedia.org/wiki/Cron#Overview) scheduling definition upon which to run the command. Seconds are generally not supported.
|
||||
|
||||
Zero or more cron commands can be specified per app. Cron entries are validated after the build artifact is created but before the app is deployed, and the cron schedule is updated during the post-deploy phase.
|
||||
|
||||
#### Task Environment
|
||||
|
||||
When running scheduled cron tasks, there are a few items to be aware of:
|
||||
|
||||
- Scheduled cron tasks are performed within the app environment available at runtime. If the app image does not exist, the command may fail to execute.
|
||||
- Schedules are performed on the hosting server's timezone, which is typically UTC.
|
||||
- At this time, only the `PATH` and `SHELL` environment variables are specified in the cron template.
|
||||
- Each scheduled task is executed within a one-off `run` container, and thus inherit any docker-options specified for `run` containers.Resources are never shared between scheduled tasks.
|
||||
- Tasks are always executed using the `--rm` flag, and are never executed in detached mode.
|
||||
- Scheduled cron tasks are supported on a per-scheduler basis, and are currently only implemented by the `docker-local` scheduler.
|
||||
- Tasks for _all_ apps managed by the `docker-local` scheduler are written to a single crontab file owned by the `dokku` user. The `dokku` user's crontab should be considered reserved for this purpose.
|
||||
|
||||
#### Listing Cron tasks
|
||||
|
||||
Cron tasks for an app can be listed via the `cron:list` command. This command takes an `app` argument.
|
||||
|
||||
```shell
|
||||
dokku cron:list node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
ID Schedule Command
|
||||
cGhwPT09cGhwIHRlc3QucGhwPT09QGRhaWx5 @daily node index.js
|
||||
cGhwPT09dHJ1ZT09PSogKiAqICogKg== * * * * * true
|
||||
```
|
||||
|
||||
#### Displaying reports for an app
|
||||
|
||||
You can get a report about the cron configuration for apps using the `cron:report` command:
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app cron information
|
||||
Cron task count: 2
|
||||
=====> python-sample cron information
|
||||
Cron task count: 0
|
||||
=====> ruby-sample cron information
|
||||
Cron task count: 10
|
||||
```
|
||||
|
||||
You can run the command for a specific app also.
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app cron information
|
||||
Cron task count: 2
|
||||
```
|
||||
|
||||
You can pass flags which will output only the value of the specific information you want. For example:
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app --cron-task-count
|
||||
```
|
||||
|
||||
### Self Managed Cron
|
||||
|
||||
> Warning: Self-managed cron tasks should be considered advanced usage. While the instructions are available, users are highly encouraged to use the built-in scheduled cron task support unless absolutely necessary.
|
||||
|
||||
Some installations may require more fine-grained control over cron usage. The following are advanced instructions for configuring cron.
|
||||
|
||||
#### Using `run` for cron tasks
|
||||
|
||||
You can always use a one-off container to run an app task:
|
||||
|
||||
```shell
|
||||
dokku --rm run node-js-app some-command
|
||||
dokku --rm-container run node-js-app some-command
|
||||
```
|
||||
|
||||
For tasks that should not be interrupted, run is the *preferred* method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
|
||||
|
||||
|
||||
#### Using `enter` for cron tasks
|
||||
|
||||
Your Procfile can have the following entry:
|
||||
|
||||
```Procfile
|
||||
cron: sleep infinity
|
||||
```
|
||||
|
||||
With the `cron` process scaled to `1`:
|
||||
|
||||
```shell
|
||||
dokku ps:scale node-js-app cron=1
|
||||
```
|
||||
|
||||
You can now run all your commands in that container:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app cron some-command
|
||||
```
|
||||
|
||||
Note that you can also run multiple commands at the same time to reduce memory usage, though that may result in polluting the container environment.
|
||||
|
||||
For tasks that will properly resume, you *should* use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
|
||||
|
||||
#### General cron recommendations
|
||||
|
||||
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
|
||||
|
||||
- Use the `dokku` user in your cron entry.
|
||||
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
|
||||
- Add a `MAILTO` environment variable to ship cron emails to yourself.
|
||||
- Add a `PATH` environment variable or specify the full path to binaries on the host.
|
||||
- Add a `SHELL` environment variable to specify Bash when running commands.
|
||||
- Keep your cron tasks in time-sorted order.
|
||||
- Keep your server time in UTC so you don't need to translate daylight savings time when reading the cronfile.
|
||||
- Run tasks at the lowest traffic times if possible.
|
||||
- Use cron to *trigger* jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
|
||||
- Try to keep tasks quiet so that mails only send on errors.
|
||||
- Do not silence standard error or standard out. If you silence the former, you will miss failures. Silencing the latter means you should actually make app changes to handle log levels.
|
||||
- Use a service such as [Dead Man's Snitch](https://deadmanssnitch.com) to verify that cron tasks completed successfully.
|
||||
- Add lots of comments to your cronfile, including what a task is doing, so that you don't spend time deciphering the file later.
|
||||
- Place your cronfiles in a pattern such as `/etc/cron.d/APP`.
|
||||
- Do not use non-ASCII characters in your cronfile names. cron is finicky.
|
||||
- Remember to have trailing newlines in your cronfile! cron is finicky.
|
||||
|
||||
The following is a sample cronfile that you can use for your apps:
|
||||
|
||||
```cron
|
||||
# server cron jobs
|
||||
MAILTO="mail@dokku.me"
|
||||
PATH=/usr/local/bin:/usr/bin:/bin
|
||||
SHELL=/bin/bash
|
||||
|
||||
# m h dom mon dow username command
|
||||
# * * * * * dokku command to be executed
|
||||
# - - - - -
|
||||
# | | | | |
|
||||
# | | | | +----- day of week (0 - 6) (Sunday=0)
|
||||
# | | | +------- month (1 - 12)
|
||||
# | | +--------- day of month (1 - 31)
|
||||
# | +----------- hour (0 - 23)
|
||||
# +----------- min (0 - 59)
|
||||
|
||||
### HIGH TRAFFIC TIME IS B/W 00:00 - 04:00 AND 14:00 - 23:59
|
||||
### RUN YOUR TASKS FROM 04:00 - 14:00
|
||||
### KEEP SORTED IN TIME ORDER
|
||||
|
||||
### PLACE ALL CRON TASKS BELOW
|
||||
|
||||
# removes unresponsive users from the subscriber list to decrease bounce rates
|
||||
0 0 * * * dokku dokku --rm run node-js-app some-command
|
||||
|
||||
# sends out our email alerts to users
|
||||
0 1 * * * dokku dokku ps:scale node-js-app cron=1 && dokku enter node-js-app cron some-other-command && dokku ps:scale node-js-app cron=0
|
||||
|
||||
### PLACE ALL CRON TASKS ABOVE, DO NOT REMOVE THE WHITESPACE AFTER THIS LINE
|
||||
|
||||
```
|
||||
@@ -7,28 +7,28 @@
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
<title>Dokku - {{DOC_TITLE}}</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.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.24.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/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.22.8/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.8/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<script>
|
||||
@@ -42,19 +42,10 @@
|
||||
</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.22.8/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.24.2/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>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
}
|
||||
.list-group-item {
|
||||
font-size: 14px;
|
||||
}
|
||||
.markdown-body {
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -124,16 +115,17 @@
|
||||
<a href="/{{NAME}}/deployment/application-management/" class="list-group-item">Application Management</a>
|
||||
<a href="/{{NAME}}/deployment/logs/" class="list-group-item">Application Logs</a>
|
||||
<a href="/{{NAME}}/deployment/remote-commands/" class="list-group-item">Remote Commands</a>
|
||||
<a href="/{{NAME}}/deployment/one-off-processes/" class="list-group-item">One-Off Processes/Cron</a>
|
||||
<a href="/{{NAME}}/deployment/process-management/" class="list-group-item">Process Scaling</a>
|
||||
<a href="/{{NAME}}/deployment/user-management/" class="list-group-item">User Management</a>
|
||||
<a href="/{{NAME}}/deployment/zero-downtime-deploys/" class="list-group-item">Zero Downtime Deploy Checks</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Deployment Methods</a>
|
||||
<a href="#" class="list-group-item disabled">Builders</a>
|
||||
|
||||
<a href="/{{NAME}}/deployment/methods/cloud-native-buildpacks/" class="list-group-item">Cloud Native Buildpacks</a>
|
||||
<a href="/{{NAME}}/deployment/methods/herokuish-buildpacks/" class="list-group-item">Herokuish Buildpacks</a>
|
||||
<a href="/{{NAME}}/deployment/methods/dockerfiles/" class="list-group-item">Dockerfile Deployment</a>
|
||||
<a href="/{{NAME}}/deployment/builders/builder-management/" class="list-group-item">Builder Management</a>
|
||||
<a href="/{{NAME}}/deployment/builders/cloud-native-buildpacks/" class="list-group-item">Cloud Native Buildpacks</a>
|
||||
<a href="/{{NAME}}/deployment/builders/herokuish-buildpacks/" class="list-group-item">Herokuish Buildpacks</a>
|
||||
<a href="/{{NAME}}/deployment/builders/dockerfiles/" class="list-group-item">Dockerfile Deployment</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Deployment Methods</a>
|
||||
<a href="/{{NAME}}/deployment/methods/images/" class="list-group-item">Docker Image Deployment</a>
|
||||
<a href="/{{NAME}}/deployment/methods/git/" class="list-group-item">Git Deployment</a>
|
||||
<a href="/{{NAME}}/deployment/methods/tar/" class="list-group-item">Tarfile Deployment</a>
|
||||
@@ -145,6 +137,13 @@
|
||||
<a href="/{{NAME}}/configuration/nginx/" class="list-group-item">Nginx Configuration</a>
|
||||
<a href="/{{NAME}}/configuration/ssl/" class="list-group-item">SSL Configuration</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Interacting with Processes</a>
|
||||
|
||||
<a href="/{{NAME}}/processes/entering-containers/" class="list-group-item">Entering Containers</a>
|
||||
<a href="/{{NAME}}/processes/one-off-tasks/" class="list-group-item">One-Off Tasks</a>
|
||||
<a href="/{{NAME}}/processes/process-management/" class="list-group-item">Process Management</a>
|
||||
<a href="/{{NAME}}/processes/scheduled-cron-tasks/" class="list-group-item">Scheduled Cron Tasks</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Network Management</a>
|
||||
|
||||
<a href="/{{NAME}}/networking/dns/" class="list-group-item">DNS Configuration</a>
|
||||
@@ -212,8 +211,6 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<hr>
|
||||
|
||||
Free document hosting provided by <a href="http://progrium.viewdocs.io/viewdocs/">Viewdocs</a>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,12 +7,20 @@
|
||||
|
||||
"application-deployment": "deployment/application-deployment/",
|
||||
"checks-examples": "deployment/zero-downtime-deploys/",
|
||||
"process-management": "deployment/process-management/",
|
||||
"remote-commands": "deployment/remote-commands/",
|
||||
|
||||
"deployment/buildpacks": "deployment/methods/herokuish-buildpacks/",
|
||||
"deployment/methods/buildpacks": "deployment/methods/herokuish-buildpacks/",
|
||||
"deployment/dockerfiles": "deployment/methods/dockerfiles/",
|
||||
"process-management": "processes/process-management/",
|
||||
"deployment/process-management": "processes/process-management/",
|
||||
"deployment/one-off-processes": "processes/one-off-tasks/",
|
||||
|
||||
"deployment/buildpacks": "deployment/builders/herokuish-buildpacks/",
|
||||
"deployment/methods/buildpacks": "deployment/builders/herokuish-buildpacks/",
|
||||
"deployment/dockerfiles": "deployment/builders/dockerfiles/",
|
||||
|
||||
"deployment/methods/cloud-native-buildpacks": "deployment/builders/cloud-native-buildpacks/",
|
||||
"deployment/methods/dockerfiles": "deployment/builders/dockerfiles/",
|
||||
"deployment/methods/herokuish-buildpacks": "deployment/builders/herokuish-buildpacks/",
|
||||
|
||||
"deployment/images": "deployment/methods/images/",
|
||||
"configuration-management": "configuration/environment-variables/",
|
||||
"deployment/ssl-configuration": "configuration/ssl/",
|
||||
|
||||
21
dokku
21
dokku
@@ -42,6 +42,7 @@ DOKKU_DISTRO=$(
|
||||
export DOCKER_BIN=${DOCKER_BIN:="docker"}
|
||||
|
||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish:latest"}
|
||||
export DOKKU_CNB_BUILDER=${DOKKU_CNB_BUILDER:="heroku/buildpacks"}
|
||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||
|
||||
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
|
||||
@@ -88,10 +89,13 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||
fi
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H "$0" "$@"
|
||||
exit $?
|
||||
if [[ $(id -un) != "dokku" ]]; then
|
||||
unset TMP TMPDIR TEMP TEMPDIR
|
||||
if [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]] || [[ $1 == "ssh-keys:remove" ]]; then
|
||||
@@ -237,14 +241,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
version | -v | --version)
|
||||
if [[ -f "$DOKKU_LIB_ROOT/STABLE_VERSION" ]]; then
|
||||
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/STABLE_VERSION")
|
||||
elif [[ -f "$DOKKU_LIB_ROOT/VERSION" ]]; then
|
||||
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/VERSION")
|
||||
else
|
||||
dokku_log_fail "Unable to determine dokku's version"
|
||||
fi
|
||||
echo "dokku version ${DOKKU_VERSION}"
|
||||
dokku_version
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.22.8"
|
||||
version = "0.24.2"
|
||||
[plugin.config]
|
||||
|
||||
@@ -9,6 +9,10 @@ cmd-report() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
if [[ "$APP" == "--format" ]]; then
|
||||
dokku_log_fail "--format flag not supported on global report"
|
||||
fi
|
||||
|
||||
dokku_log_info1 "uname: $(uname -a)"
|
||||
dokku_log_info1 "memory: "
|
||||
free -m | sed "s/^/ /"
|
||||
@@ -16,12 +20,14 @@ cmd-report() {
|
||||
"$DOCKER_BIN" version | sed "s/^/ /"
|
||||
dokku_log_info1 "docker daemon info: "
|
||||
"$DOCKER_BIN" -D system info | sed "s/^/ /"
|
||||
dokku_log_info1 "git version: $(git --version)"
|
||||
dokku_log_info1 "sigil version: $(sigil -v)"
|
||||
dokku_log_info1 "herokuish version: "
|
||||
"$DOCKER_BIN" container run $DOKKU_GLOBAL_RUN_ARGS --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
|
||||
dokku_log_info1 "dokku version: $(dokku version)"
|
||||
dokku_log_info1 "dokku version: $(dokku_version)"
|
||||
dokku_log_info1 "plugn version: $(plugn version)"
|
||||
dokku_log_info1 "dokku plugins: "
|
||||
dokku plugin:list | sed "s/^/ /"
|
||||
plugn list | sed "s/^/ /"
|
||||
|
||||
if [[ "$APP" == "--all" ]]; then
|
||||
for app in $(dokku_apps); do
|
||||
|
||||
@@ -8,11 +8,24 @@ cmd-run() {
|
||||
declare cmd="run"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP=""
|
||||
|
||||
local SCHEDULER_ID
|
||||
declare -a RUN_ENV
|
||||
RUN_ENV=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--cron-id=*)
|
||||
local arg=$(printf "%s" "$1" | sed -E 's/(^--cron-id=)//g')
|
||||
SCHEDULER_ID+=("$arg")
|
||||
shift
|
||||
;;
|
||||
--cron-id)
|
||||
if [[ ! $2 ]]; then
|
||||
dokku_log_warn "expected $1 to have an argument"
|
||||
break
|
||||
fi
|
||||
CRON_ID+=("$2")
|
||||
shift 2
|
||||
;;
|
||||
-e=* | --env=*)
|
||||
local arg=$(printf "%s" "$1" | sed -E 's/(^-e=)|(^--env=)//g')
|
||||
RUN_ENV+=("$arg")
|
||||
@@ -37,7 +50,7 @@ cmd-run() {
|
||||
verify_app_name "$APP"
|
||||
|
||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
|
||||
DOKKU_CRON_ID="$CRON_ID" plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
|
||||
}
|
||||
|
||||
cmd-run "$@"
|
||||
|
||||
1
plugins/20_events/builder-detect
Symbolic link
1
plugins/20_events/builder-detect
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/config-export
Symbolic link
1
plugins/20_events/config-export
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/cron-entries
Symbolic link
1
plugins/20_events/cron-entries
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/cron-write
Symbolic link
1
plugins/20_events/cron-write
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -8,8 +8,8 @@ cmd-events-help() {
|
||||
local plugin_name="events"
|
||||
local plugin_description="Manage event logging"
|
||||
|
||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
||||
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||
echo ''
|
||||
echo "$plugin_description"
|
||||
echo ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.22.8"
|
||||
version = "0.24.2"
|
||||
[plugin.config]
|
||||
|
||||
1
plugins/20_events/scheduler-register-retired
Symbolic link
1
plugins/20_events/scheduler-register-retired
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/storage-list
Symbolic link
1
plugins/20_events/storage-list
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/app-json/.gitignore
vendored
1
plugins/app-json/.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/triggers
|
||||
/pre-*
|
||||
/post-*
|
||||
/install
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
TRIGGERS = triggers/post-deploy triggers/pre-deploy
|
||||
TRIGGERS = triggers/install triggers/post-delete triggers/post-deploy triggers/pre-deploy
|
||||
BUILD = triggers
|
||||
PLUGIN_NAME = app-json
|
||||
|
||||
|
||||
@@ -1,406 +1,35 @@
|
||||
package appjson
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
// AppJSON is a struct that represents an app.json file as understood by Dokku
|
||||
type AppJSON struct {
|
||||
Cron []CronCommand `json:"cron"`
|
||||
Scripts struct {
|
||||
Dokku struct {
|
||||
Predeploy string `json:"predeploy"`
|
||||
Postdeploy string `json:"postdeploy"`
|
||||
} `json:"dokku"`
|
||||
Postdeploy string `json:"postdeploy"`
|
||||
} `json:"scripts"`
|
||||
}
|
||||
|
||||
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
|
||||
if hasEntrypoint {
|
||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||
if err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
|
||||
return nil
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
script := []string{"set -eo pipefail;"}
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
script = append(script, "set -x;")
|
||||
}
|
||||
|
||||
if isHerokuishImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/app' ]]; then",
|
||||
" export HOME=/app;",
|
||||
" cd $HOME;",
|
||||
"fi;",
|
||||
"if [[ -d '/app/.profile.d' ]]; then",
|
||||
" for file in /app/.profile.d/*; do source $file; done;",
|
||||
"fi;",
|
||||
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -rf /tmp/cache ;",
|
||||
" ln -sf /cache /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(command, "/") {
|
||||
commandBin := strings.Split(command, " ")[0]
|
||||
script = append(script, []string{
|
||||
fmt.Sprintf("if [[ ! -x \"%s\" ]]; then", commandBin),
|
||||
" echo specified binary is not executable;",
|
||||
" exit 1;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
||||
|
||||
if isHerokuishImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -f /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
return []string{shell, "-c", strings.Join(script, " ")}
|
||||
// CronCommand is a struct that represents a single cron command from an app.json file
|
||||
type CronCommand struct {
|
||||
Command string `json:"command"`
|
||||
Schedule string `json:"schedule"`
|
||||
}
|
||||
|
||||
// getPhaseScript extracts app.json from app image and returns the appropriate json key/value
|
||||
func getPhaseScript(appName string, image string, phase string) (string, error) {
|
||||
appJSONFile, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("dokku-%s-%s", common.MustGetEnv("DOKKU_PID"), "getPhaseScript"))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot create temporary file: %v", err)
|
||||
}
|
||||
|
||||
defer os.Remove(appJSONFile.Name())
|
||||
|
||||
common.CopyFromImage(appName, image, "app.json", appJSONFile.Name())
|
||||
if !common.FileExists(appJSONFile.Name()) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadFile(appJSONFile.Name())
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(string(b)) == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var appJSON AppJSON
|
||||
if err = json.Unmarshal(b, &appJSON); err != nil {
|
||||
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
||||
}
|
||||
|
||||
if phase == "predeploy" {
|
||||
return appJSON.Scripts.Dokku.Predeploy, nil
|
||||
}
|
||||
|
||||
return appJSON.Scripts.Dokku.Postdeploy, nil
|
||||
// GetAppjsonDirectory returns the directory containing a given app's extracted app.json file
|
||||
func GetAppjsonDirectory(appName string) string {
|
||||
return filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json", appName)
|
||||
}
|
||||
|
||||
// getReleaseCommand extracts the release command from a given app's procfile
|
||||
func getReleaseCommand(appName string, image string) string {
|
||||
err := common.SuppressOutput(func() error {
|
||||
return common.PlugnTrigger("procfile-extract", []string{appName, image}...)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
processType := "release"
|
||||
port := "5000"
|
||||
b, _ := common.PlugnTriggerOutput("procfile-get-command", []string{appName, processType, port}...)
|
||||
return strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
func getDokkuAppShell(appName string) string {
|
||||
shell := "/bin/bash"
|
||||
globalShell := ""
|
||||
appShell := ""
|
||||
|
||||
ctx := context.Background()
|
||||
errs, ctx := errgroup.WithContext(ctx)
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...)
|
||||
globalShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-global", []string{"DOKKU_APP_SHELL"}...)
|
||||
appShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
|
||||
errs.Wait()
|
||||
if appShell != "" {
|
||||
shell = appShell
|
||||
} else if globalShell != "" {
|
||||
shell = globalShell
|
||||
}
|
||||
|
||||
return shell
|
||||
}
|
||||
|
||||
func executeScript(appName string, imageTag string, phase string) error {
|
||||
common.LogInfo1(fmt.Sprintf("Checking for %s task", phase))
|
||||
image, err := common.GetDeployingAppImageName(appName, imageTag, "")
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
command := ""
|
||||
phaseSource := ""
|
||||
if phase == "release" {
|
||||
command = getReleaseCommand(appName, image)
|
||||
phaseSource = "Procfile"
|
||||
} else {
|
||||
var err error
|
||||
phaseSource = "app.json"
|
||||
if command, err = getPhaseScript(appName, image, phase); err != nil {
|
||||
common.LogExclaim(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
common.LogVerbose(fmt.Sprintf("No %s task found, skipping", phase))
|
||||
return nil
|
||||
}
|
||||
|
||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||
dockerfileEntrypoint := ""
|
||||
dockerfileCommand := ""
|
||||
if !isHerokuishImage {
|
||||
dockerfileEntrypoint, _ = getEntrypointFromImage(image)
|
||||
dockerfileCommand, _ = getCommandFromImage(image)
|
||||
}
|
||||
|
||||
hasEntrypoint := dockerfileEntrypoint != ""
|
||||
dokkuAppShell := getDokkuAppShell(appName)
|
||||
script := constructScript(command, dokkuAppShell, isHerokuishImage, hasEntrypoint)
|
||||
|
||||
imageSourceType := "dockerfile"
|
||||
if isHerokuishImage {
|
||||
imageSourceType = "herokuish"
|
||||
}
|
||||
|
||||
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
||||
cacheHostDir := fmt.Sprintf("%s/cache", common.AppHostRoot(appName))
|
||||
if !common.DirectoryExists(cacheDir) {
|
||||
os.MkdirAll(cacheDir, 0755)
|
||||
}
|
||||
|
||||
var dockerArgs []string
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-deploy", []string{appName, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-process-deploy", []string{appName, imageSourceType, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
filteredArgs := []string{"restart", "cpus", "memory", "memory-swap", "memory-reservation", "gpus"}
|
||||
for _, filteredArg := range filteredArgs {
|
||||
// re := regexp.MustCompile("--" + filteredArg + "=[0-9A-Za-z!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]+ ")
|
||||
|
||||
var filteredDockerArgs []string
|
||||
for _, dockerArg := range dockerArgs {
|
||||
if !strings.HasPrefix(dockerArg, "--"+filteredArg+"=") {
|
||||
filteredDockerArgs = append(filteredDockerArgs, dockerArg)
|
||||
}
|
||||
}
|
||||
|
||||
dockerArgs = filteredDockerArgs
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, "--label=dokku_phase_script="+phase)
|
||||
dockerArgs = append(dockerArgs, "-v", cacheHostDir+":/cache")
|
||||
if os.Getenv("DOKKU_TRACE") != "" {
|
||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||
}
|
||||
|
||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||
if err != nil {
|
||||
common.LogFail(fmt.Sprintf("Failed to create %s execution container: %s", phase, err.Error()))
|
||||
}
|
||||
|
||||
if !waitForExecution(containerID) {
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogFail(fmt.Sprintf("Execution of %s task failed: %s", phase, command))
|
||||
}
|
||||
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
|
||||
if phase != "predeploy" {
|
||||
return nil
|
||||
}
|
||||
|
||||
commitArgs := []string{"container", "commit"}
|
||||
if !isHerokuishImage {
|
||||
if dockerfileEntrypoint != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
||||
}
|
||||
|
||||
if dockerfileCommand != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileCommand)
|
||||
}
|
||||
}
|
||||
|
||||
commitArgs = append(commitArgs, []string{
|
||||
"--change",
|
||||
"LABEL org.label-schema.schema-version=1.0",
|
||||
"--change",
|
||||
"LABEL org.label-schema.vendor=dokku",
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.app-name=%s", appName),
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.%s-phase=true", phase),
|
||||
}...)
|
||||
commitArgs = append(commitArgs, containerID, image)
|
||||
containerCommitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
commitArgs...,
|
||||
)
|
||||
containerCommitCmd.ShowOutput = false
|
||||
containerCommitCmd.Command.Stderr = os.Stderr
|
||||
if !containerCommitCmd.Execute() {
|
||||
common.LogFail(fmt.Sprintf("Commiting of '%s' to image failed: %s", phase, command))
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("scheduler-register-retired", []string{appName, containerID}...)
|
||||
}
|
||||
|
||||
func getEntrypointFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Entrypoint}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var entrypoint []string
|
||||
if err = json.Unmarshal([]byte(output), &entrypoint); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(entrypoint) == 3 && entrypoint[0] == "/bin/sh" && entrypoint[1] == "-c" {
|
||||
return fmt.Sprintf("ENTRYPOINT %s", entrypoint[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(entrypoint)
|
||||
return fmt.Sprintf("ENTRYPOINT %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func getCommandFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Cmd}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var command []string
|
||||
if err = json.Unmarshal([]byte(output), &command); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(command) == 3 && command[0] == "/bin/sh" && command[1] == "-c" {
|
||||
return fmt.Sprintf("CMD %s", command[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(command)
|
||||
return fmt.Sprintf("CMD %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func waitForExecution(containerID string) bool {
|
||||
containerStartCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"start",
|
||||
containerID,
|
||||
)
|
||||
containerStartCmd.ShowOutput = false
|
||||
containerStartCmd.Command.Stderr = os.Stderr
|
||||
if !containerStartCmd.Execute() {
|
||||
return false
|
||||
}
|
||||
|
||||
containerWaitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"wait",
|
||||
containerID,
|
||||
)
|
||||
|
||||
containerWaitCmd.ShowOutput = false
|
||||
containerWaitCmd.Command.Stderr = os.Stderr
|
||||
b, err := containerWaitCmd.Output()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
containerExitCode := strings.TrimSpace(string(b[:]))
|
||||
return containerExitCode == "0"
|
||||
}
|
||||
|
||||
func createdContainerID(appName string, dockerArgs []string, image string, command []string, phase string) (string, error) {
|
||||
runLabelArgs := fmt.Sprintf("--label=com.dokku.app-name=%s", appName)
|
||||
|
||||
arguments := strings.Split(common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"), " ")
|
||||
arguments = append(arguments, runLabelArgs)
|
||||
arguments = append(arguments, dockerArgs...)
|
||||
|
||||
arguments = append([]string{"container", "create"}, arguments...)
|
||||
arguments = append(arguments, image)
|
||||
arguments = append(arguments, command...)
|
||||
|
||||
containerCreateCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
arguments...,
|
||||
)
|
||||
var stderr bytes.Buffer
|
||||
containerCreateCmd.ShowOutput = false
|
||||
containerCreateCmd.Command.Stderr = &stderr
|
||||
|
||||
b, err := containerCreateCmd.Output()
|
||||
if err != nil {
|
||||
return "", errors.New(stderr.String())
|
||||
}
|
||||
|
||||
containerID := strings.TrimSpace(string(b))
|
||||
err = common.PlugnTrigger("post-container-create", []string{"app", appName, containerID, phase}...)
|
||||
return containerID, err
|
||||
// GetAppjsonPath returns the path to a given app's extracted app.json file
|
||||
func GetAppjsonPath(appName string) string {
|
||||
return filepath.Join(GetAppjsonDirectory(appName), "app.json")
|
||||
}
|
||||
|
||||
437
plugins/app-json/functions.go
Normal file
437
plugins/app-json/functions.go
Normal file
@@ -0,0 +1,437 @@
|
||||
package appjson
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func constructScript(command string, shell string, isHerokuishImage bool, isCnbImage bool, hasEntrypoint bool) []string {
|
||||
if hasEntrypoint {
|
||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||
if err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
|
||||
return nil
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
script := []string{"set -eo pipefail;"}
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
script = append(script, "set -x;")
|
||||
}
|
||||
|
||||
if isHerokuishImage && !isCnbImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/app' ]]; then",
|
||||
" export HOME=/app;",
|
||||
" cd $HOME;",
|
||||
"fi;",
|
||||
"if [[ -d '/app/.profile.d' ]]; then",
|
||||
" for file in /app/.profile.d/*; do source $file; done;",
|
||||
"fi;",
|
||||
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -rf /tmp/cache ;",
|
||||
" ln -sf /cache /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(command, "/") {
|
||||
commandBin := strings.Split(command, " ")[0]
|
||||
script = append(script, []string{
|
||||
fmt.Sprintf("if [[ ! -x \"%s\" ]]; then", commandBin),
|
||||
" echo specified binary is not executable;",
|
||||
" exit 1;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
||||
|
||||
if isHerokuishImage && !isCnbImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -f /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
return []string{shell, "-c", strings.Join(script, " ")}
|
||||
}
|
||||
|
||||
// getPhaseScript extracts app.json from app image and returns the appropriate json key/value
|
||||
func getPhaseScript(appName string, phase string) (string, error) {
|
||||
if !common.FileExists(GetAppjsonPath(appName)) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadFile(GetAppjsonPath(appName))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(string(b)) == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var appJSON AppJSON
|
||||
if err = json.Unmarshal(b, &appJSON); err != nil {
|
||||
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
||||
}
|
||||
|
||||
if phase == "heroku.postdeploy" {
|
||||
return appJSON.Scripts.Postdeploy, nil
|
||||
}
|
||||
|
||||
if phase == "predeploy" {
|
||||
return appJSON.Scripts.Dokku.Predeploy, nil
|
||||
}
|
||||
|
||||
return appJSON.Scripts.Dokku.Postdeploy, nil
|
||||
}
|
||||
|
||||
// getReleaseCommand extracts the release command from a given app's procfile
|
||||
func getReleaseCommand(appName string, image string) string {
|
||||
err := common.SuppressOutput(func() error {
|
||||
return common.PlugnTrigger("procfile-extract", []string{appName, image}...)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
processType := "release"
|
||||
port := "5000"
|
||||
b, _ := common.PlugnTriggerOutput("procfile-get-command", []string{appName, processType, port}...)
|
||||
return strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
func getDokkuAppShell(appName string) string {
|
||||
shell := "/bin/bash"
|
||||
globalShell := ""
|
||||
appShell := ""
|
||||
|
||||
ctx := context.Background()
|
||||
errs, ctx := errgroup.WithContext(ctx)
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...)
|
||||
globalShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...)
|
||||
appShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
|
||||
errs.Wait()
|
||||
if appShell != "" {
|
||||
shell = appShell
|
||||
} else if globalShell != "" {
|
||||
shell = globalShell
|
||||
}
|
||||
|
||||
return shell
|
||||
}
|
||||
|
||||
func executeScript(appName string, image string, imageTag string, phase string) error {
|
||||
phaseName := phase
|
||||
if phase == "heroku.postdeploy" {
|
||||
phaseName = "first deploy postdeploy"
|
||||
}
|
||||
common.LogInfo1(fmt.Sprintf("Checking for %s task", phaseName))
|
||||
command := ""
|
||||
phaseSource := ""
|
||||
if phase == "release" {
|
||||
command = getReleaseCommand(appName, image)
|
||||
phaseSource = "Procfile"
|
||||
} else {
|
||||
var err error
|
||||
phaseSource = "app.json"
|
||||
if command, err = getPhaseScript(appName, phase); err != nil {
|
||||
common.LogExclaim(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
common.LogVerbose(fmt.Sprintf("No %s task found, skipping", phaseName))
|
||||
return nil
|
||||
}
|
||||
|
||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phaseName, phaseSource, command))
|
||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||
isCnbImage := common.IsImageCnbBased(image)
|
||||
dockerfileEntrypoint := ""
|
||||
dockerfileCommand := ""
|
||||
if !isHerokuishImage {
|
||||
dockerfileEntrypoint, _ = getEntrypointFromImage(image)
|
||||
dockerfileCommand, _ = getCommandFromImage(image)
|
||||
}
|
||||
|
||||
hasEntrypoint := dockerfileEntrypoint != ""
|
||||
dokkuAppShell := getDokkuAppShell(appName)
|
||||
script := constructScript(command, dokkuAppShell, isHerokuishImage, isCnbImage, hasEntrypoint)
|
||||
|
||||
imageSourceType := "dockerfile"
|
||||
if isHerokuishImage {
|
||||
imageSourceType = "herokuish"
|
||||
} else if isCnbImage {
|
||||
imageSourceType = "pack"
|
||||
}
|
||||
|
||||
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
||||
cacheHostDir := fmt.Sprintf("%s/cache", common.AppHostRoot(appName))
|
||||
if !common.DirectoryExists(cacheDir) {
|
||||
os.MkdirAll(cacheDir, 0755)
|
||||
}
|
||||
|
||||
var dockerArgs []string
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-deploy", []string{appName, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-process-deploy", []string{appName, imageSourceType, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
filteredArgs := []string{"restart", "cpus", "memory", "memory-swap", "memory-reservation", "gpus"}
|
||||
for _, filteredArg := range filteredArgs {
|
||||
// re := regexp.MustCompile("--" + filteredArg + "=[0-9A-Za-z!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]+ ")
|
||||
|
||||
var filteredDockerArgs []string
|
||||
for _, dockerArg := range dockerArgs {
|
||||
if !strings.HasPrefix(dockerArg, "--"+filteredArg+"=") {
|
||||
filteredDockerArgs = append(filteredDockerArgs, dockerArg)
|
||||
}
|
||||
}
|
||||
|
||||
dockerArgs = filteredDockerArgs
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, "--label=dokku_phase_script="+phase)
|
||||
dockerArgs = append(dockerArgs, "-v", cacheHostDir+":/cache")
|
||||
if os.Getenv("DOKKU_TRACE") != "" {
|
||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||
}
|
||||
if isCnbImage {
|
||||
// TODO: handle non-linux lifecycles
|
||||
// Ideally we don't have to override this but `pack` injects the web process
|
||||
// as the default entrypoint, so we need to specify the launcher so the script
|
||||
// runs as expected
|
||||
dockerArgs = append(dockerArgs, "--entrypoint=/cnb/lifecycle/launcher")
|
||||
}
|
||||
|
||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to create %s execution container: %s", phase, err.Error())
|
||||
}
|
||||
|
||||
if !waitForExecution(containerID) {
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phaseName, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phaseName, containerID[0:9]))
|
||||
return fmt.Errorf("Execution of %s task failed: %s", phaseName, command)
|
||||
}
|
||||
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phaseName, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phaseName, containerID[0:9]))
|
||||
|
||||
if phase != "predeploy" {
|
||||
return nil
|
||||
}
|
||||
|
||||
commitArgs := []string{"container", "commit"}
|
||||
if !isHerokuishImage || isCnbImage {
|
||||
if dockerfileEntrypoint != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
||||
}
|
||||
|
||||
if dockerfileCommand != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileCommand)
|
||||
}
|
||||
}
|
||||
|
||||
commitArgs = append(commitArgs, []string{
|
||||
"--change",
|
||||
"LABEL org.label-schema.schema-version=1.0",
|
||||
"--change",
|
||||
"LABEL org.label-schema.vendor=dokku",
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.app-name=%s", appName),
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.%s-phase=true", phase),
|
||||
}...)
|
||||
commitArgs = append(commitArgs, containerID, image)
|
||||
containerCommitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
commitArgs...,
|
||||
)
|
||||
containerCommitCmd.ShowOutput = false
|
||||
containerCommitCmd.Command.Stderr = os.Stderr
|
||||
if !containerCommitCmd.Execute() {
|
||||
return fmt.Errorf("Commiting of '%s' to image failed: %s", phase, command)
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("scheduler-register-retired", []string{appName, containerID}...)
|
||||
}
|
||||
|
||||
func getEntrypointFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Entrypoint}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var entrypoint []string
|
||||
if err = json.Unmarshal([]byte(output), &entrypoint); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(entrypoint) == 3 && entrypoint[0] == "/bin/sh" && entrypoint[1] == "-c" {
|
||||
return fmt.Sprintf("ENTRYPOINT %s", entrypoint[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(entrypoint)
|
||||
return fmt.Sprintf("ENTRYPOINT %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func getCommandFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Cmd}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var command []string
|
||||
if err = json.Unmarshal([]byte(output), &command); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(command) == 3 && command[0] == "/bin/sh" && command[1] == "-c" {
|
||||
return fmt.Sprintf("CMD %s", command[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(command)
|
||||
return fmt.Sprintf("CMD %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func waitForExecution(containerID string) bool {
|
||||
containerStartCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"start",
|
||||
containerID,
|
||||
)
|
||||
containerStartCmd.ShowOutput = false
|
||||
containerStartCmd.Command.Stderr = os.Stderr
|
||||
if !containerStartCmd.Execute() {
|
||||
return false
|
||||
}
|
||||
|
||||
containerWaitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"wait",
|
||||
containerID,
|
||||
)
|
||||
|
||||
containerWaitCmd.ShowOutput = false
|
||||
containerWaitCmd.Command.Stderr = os.Stderr
|
||||
b, err := containerWaitCmd.Output()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
containerExitCode := strings.TrimSpace(string(b[:]))
|
||||
return containerExitCode == "0"
|
||||
}
|
||||
|
||||
func createdContainerID(appName string, dockerArgs []string, image string, command []string, phase string) (string, error) {
|
||||
runLabelArgs := fmt.Sprintf("--label=com.dokku.app-name=%s", appName)
|
||||
|
||||
arguments := strings.Split(common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"), " ")
|
||||
arguments = append(arguments, runLabelArgs)
|
||||
arguments = append(arguments, dockerArgs...)
|
||||
|
||||
arguments = append([]string{"container", "create"}, arguments...)
|
||||
arguments = append(arguments, image)
|
||||
arguments = append(arguments, command...)
|
||||
|
||||
b, err := common.PlugnTriggerOutput("config-export", []string{appName, "false", "true", "json"}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var env map[string]string
|
||||
if err := json.Unmarshal(b, &env); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
containerCreateCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
arguments...,
|
||||
)
|
||||
var stderr bytes.Buffer
|
||||
containerCreateCmd.Env = env
|
||||
containerCreateCmd.ShowOutput = false
|
||||
containerCreateCmd.Command.Stderr = &stderr
|
||||
|
||||
b, err = containerCreateCmd.Output()
|
||||
if err != nil {
|
||||
return "", errors.New(stderr.String())
|
||||
}
|
||||
|
||||
containerID := strings.TrimSpace(string(b))
|
||||
err = common.PlugnTrigger("post-container-create", []string{"app", appName, containerID, phase}...)
|
||||
return containerID, err
|
||||
}
|
||||
|
||||
func refreshAppJSON(appName string, image string) error {
|
||||
baseDirectory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json")
|
||||
if !common.DirectoryExists(baseDirectory) {
|
||||
return errors.New("Run 'dokku plugin:install' to ensure the correct directories exist")
|
||||
}
|
||||
|
||||
directory := GetAppjsonDirectory(appName)
|
||||
if !common.DirectoryExists(directory) {
|
||||
if err := os.MkdirAll(directory, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
appjsonPath := GetAppjsonPath(appName)
|
||||
if common.FileExists(appjsonPath) {
|
||||
if err := os.Remove(appjsonPath); err != nil {
|
||||
return errors.New("Unable to remove previous app.json file")
|
||||
}
|
||||
}
|
||||
|
||||
common.CopyFromImage(appName, image, "app.json", appjsonPath)
|
||||
return nil
|
||||
}
|
||||
@@ -6,5 +6,6 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core app-json plugin"
|
||||
version = "0.22.8"
|
||||
version = "0.24.2"
|
||||
[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