Comments (5)
I'm not sure what you are trying to do. Do you mean the container was destroyed so you needed another one with the same config/volume?
from dokku-mariadb.
Exactly. I need to start a new container but keep the config/volume.
create
says that the service already exists.
start
says that no container exists.
And both are right.
I was stuck so I created this command:
$PLUGIN_COMMAND_PREFIX:deploy)
[[ -z $2 ]] && dokku_log_fail "Please specify a name for the service"
[[ -d "$PLUGIN_DATA_ROOT/$2" ]] || dokku_log_fail "$PLUGIN_SERVICE service $2 does not exist"
SERVICE="$2"; SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"; LINKS_FILE="$SERVICE_ROOT/LINKS"
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " ; then
dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION not found"
fi
rootpassword=$(cat "$SERVICE_ROOT/ROOTPASSWORD")
password=$(cat "$SERVICE_ROOT/PASSWORD")
dokku_log_info1 "Starting container"
SERVICE_NAME=$(get_service_name "$SERVICE")
ID=$(docker run --name "$SERVICE_NAME" -v "$SERVICE_ROOT/data:/var/lib/mysql" -e "MYSQL_ROOT_PASSWORD=$rootpassword" -e MYSQL_USER=mariadb -e "MYSQL_PASSWORD=$password" -e "MYSQL_DATABASE=$SERVICE" -d --restart always --label dokku=service --label dokku.service=mariadb "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION")
echo "$ID" > "$SERVICE_ROOT/ID"
dokku_log_verbose_quiet "Waiting for container to be ready"
docker run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" dokkupaas/wait > /dev/null
dokku_log_info2 "$PLUGIN_SERVICE container created: $SERVICE"
dokku "$PLUGIN_COMMAND_PREFIX:info" "$SERVICE"
;;
That is like create
but it reads the configuration instead of creating/writing it.
from dokku-mariadb.
start
should probably warn and then create the container. That seems reasonable to me. Mind creating a pr with that functionality? I can port it to the other containers once you do.
from dokku-mariadb.
Sure, I was waiting to discuss if it should be a new command or not to create a PR. And I have the answer now :)
from dokku-mariadb.
Closed by #44
from dokku-mariadb.
Related Issues (20)
- ADD bash_completion support: autocomplete mariadb service names HOT 2
- Cannot run `mariadb:connect` and `mariadb:export` commands HOT 1
- How to connect with client via ssh tunnel? HOT 17
- After installing, I get error when running any docker command HOT 10
- Restore from filesys backup HOT 6
- Kills itself when not enough memory? HOT 4
- dokku mariadb:create <service> freezes HOT 2
- Diagnosing database status HOT 2
- How to configure my.cnf HOT 8
- Locking tables HOT 8
- How to override plugin alias HOT 2
- Error while trying to setup backup - Container is restarting HOT 3
- Consider to change default character set to utf8 HOT 6
- Consider having single-instance mode HOT 3
- Database stuck in 'Restarting' HOT 3
- What is the format of schedule exactly? HOT 1
- dokku mariadb:export locks tables HOT 1
- Shared database container? HOT 1
- ERROR: unable to connect HOT 20
- Allow to override user on create HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokku-mariadb.