Appwrite succesfullyu installed but a new directory isnt created - docker

I have installed Appwrite. But a new directory conating the docker-compose.yml and .env has not been created. The terminal is giving a sucess message. Docker is also working properly.
I installed appwrite through following commands:
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:0.13.4
Have a look of my terminal screen:

Have you installed Appwrite before on this machine? If you have, then it isn't something to be concerned about. Notice how your docker compose is pointing to /usr/src/code/appwrite/docker-compose.yml? This is probably your past installation, and your local Docker volumes still point there.
Everything will still work correctly :)

Related

volumes not working with Datapower and docker

I am using docker datapower image for local development. I am using this image
https://hub.docker.com/layers/ibmcom/datapower/latest/images/sha256-35b1a3fcb57d7e036d60480a25e2709e517901f69fab5407d70ccd4b985c2725?context=explore
Datapower version: IDG.10.0.1.0
System: Docker for mac
Docker version 19.03.13
I am running the container with the following config
docker run -it \
-v $PWD/config:/drouter/config \
-v $PWD/local:/drouter/local \
-e DATAPOWER_ACCEPT_LICENSE=true \
-e DATAPOWER_INTERACTIVE=true \
-p 9090:9090 \
-p 9022:22 \
-p 5554:5554 \
-p 8000-8010:8000-8010 \
ibmcom/datapower
when I create files in file management or save a DP object configuration I do not see the changes reflected in the directory on my machine
also I would expect to be able to create files on my host directory and see them reflected in /drouter/config + /drouter/local in the container as well as in the management GUI
the volume mounts don't seem to be working correctly or perhaps I misunderstand something about Datapower or Docker
I have tried mounting volumes in other docker containers under the same path and that works fine so I don't think its an issue with file sharing settings in docker.
The file system structure changed in version 10.0. There is some documentation in the IBM Knowledge Center showing the updated locations for config:, local:, etc., but the Dockerhub page is not updated to reflect that yet.
mounting the volumes like this fixed it for me
-v $PWD/config:/opt/ibm/datapower/drouter/config \
-v $PWD/local:/opt/ibm/datapower/drouter/local \
It seems the container is persisting configuration here instead. This is different than the instructions on dockerHub

Docker basics, how to keep installed packages and edited files?

Do I understand Docker correctly?
docker run -it --rm --name verdaccio -p 4873:4873 -d verdaccio/verdaccio
gets verdaccio if it does not exist yet on my server and runs it on a specific port. -d detaches it so I can leave the terminal and keep it running right?
docker exec -it --user root verdaccio /bin/sh
lets me ssh into the running container. However whatever apk package that I add would be lost if I rm the container then run the image again, as well as any edited file. So what's the use of this? Can I keep the changes in the image?
As I need to edit the config.yaml that is present in /verdaccio/conf/config.yaml (in the container), my only option to keep this changes is to detach the data from the running instance? Is there another way?
V_PATH=/path/on/my/server/verdaccio; docker run -it --rm --name
verdaccio -p 4873:4873 \
-v $V_PATH/conf:/verdaccio/conf \
-v $V_PATH/storage:/verdaccio/storage \
-v $V_PATH/plugins:/verdaccio/plugins \
verdaccio/verdaccio
However this command would throw
fatal--- cannot open config file /verdaccio/conf/config.yaml: ENOENT: no such file or directory, open '/verdaccio/conf/config.yaml'
You can use docker commit to build a new image based on the container.
A better approach however is to use a Dockerfile that builds an image based on verdaccio/verdaccio with the necessary changes in it. This makes the process easily repeatable (for example if a new version of the base image comes out).
A further option is the use of volumes as you already mentioned.

Conflict. The container name "/gitlab-runner" is already in use by container

I'm following this guide to install docker for my GitLab server running on Ubuntu 16.4.
When I execute the following command:
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
So far so good. However, when I run the next command to register the runner from this guide:
docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner --name gitlab-runner gitlab/gitlab-runner register
I keep getting the message:
docker: Error response from daemon: Conflict. The container name "/gitlab-runner" is already in use by container "b055ded012f9d0ed085fe84756604464afbb11871b432a21300064333e34cb1d". You have to remove (or rename) that container to be able to reuse that name.
However, when I run docker container list to see the list of containers, it's empty.
Anyone know how I can fix this error?
Just to add my 2-cents as I've also recently been through those GitLab documents to get the Docker GitLab runner working.
Following the Docker image installation and configuration guide, it tells you to start that container, however that I believe, is a mistake, and you want to do that after registering the Runner.
If you did run:
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
Just remove the docker container with docker rm -f gitlab-runner, and move on to registering the runner.
docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner --name gitlab-runner gitlab/gitlab-runner register
This would register the runner, and also place the configuration in /srv/gitlab-runner/config/config.toml on the local machine.
You can then run the original docker run:
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
(NB, if this doesn't work because of the name being in use again - just run the docker rm -f gitlab-runner command again - you won't lose the gitlab-runner configuration).
And that would stand up the Docker gitlab-runner with the configuration set from the register command.
Hope this helps!
You're trying to run two containers with the same name? Where did these instructions come from? Then in your response you're saying you get the error 'No such container: gitlab-runner-config' but that's not the name of any of the containers you're trying to run?
Seems that your first container is meant to be called gitlab-runner-config based on everything else I see in there, including your volumes-from. Probably that's why gitlab-runner doesn't show up in docker ps, because you're trying to get volumes from a container that doesn't exist. Try clearing everything, and then run the following:
$ docker run -d --name gitlab-runner-config --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
...
$ docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
--volumes-from gitlab-runner-config \
gitlab/gitlab-runner:latest
EDIT: OK so I read the guide, you're following the instructions wrong. It's saying in step 2, either do the one command, or the two afterwards. Either do a combined config and run container (which is called gitlab-runner) or do a config container (called gitlab-runner-config) then a runner container (called gitlab-runner). You're doing multiple steps with the same container name but mixing them up.
Run docker ps -a and you will see all your containers (even the not running ones), if you use the --rm option on run your container will be removed when stopped if that is the behaviour you are after.
You could always just skip the whole --name option if you want to create more than one of the same image and don't care about the name.
I also came across this, and opened an issue against the GitLab documentation. Here's my comment in there:
Actually, I think the issue might be something different:
On step 3, clicking on the link takes you to https://docs.gitlab.com/runner/register/index.html#docker.
In doing this, you land on the right section, near the end of the page. But this also means that you miss one important bit of information at the top of the page:
Before registering a Runner, you need to first:
Install it on a server separate than where GitLab is installed on
Obtain a token for a shared or specific Runner via GitLab's interface
That is, the documentation instructions recommend and assume that the gitlab runner container is on another machine. Thus they are not expected to work for containers on the same one.
My suggestion would be to add a note after the register step to check the registration requirements at the top of the page first.
Other than that, #johnharris85's answer would work for registering the runner on the same machine. The only extra thing you'd need to do is to add the --network="host" option to the command to do the registration. That is:
sudo docker run --rm -t -i \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
--network="host" --name gitlab-runner-register \
gitlab/gitlab-runner register

Docker invalid characters for volume when using relative paths

Ive been given a docker container which is run via a bash script. The container should set up a php web app, it then goes on to call other scripts and containers. It seems to work fine for others, but for me its throwing an error.
This is the code
sudo docker run -d \
--name eluci \
-v ./config/eluci.settings:/mnt/eluci.settings \
-v ./config/elucid.log4j.settings.xml:/mnt/eluci.log4j.settings.xml \
--link eluci-database:eluci-database \
/opt/eluci/run_eluci.sh
This is the error
docker: Error response from daemon: create ./config/eluci.settings:
"./config/eluci.settings" includes invalid characters for a local
volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to
pass a host directory, use absolute path.
Im running docker on a centos VM using virtualbox on a windows 7 host.
From googling it seems to be something to do with the mount, however I dont want to change it in case the setting it breaks or is relied upon in another docker container. I still have a few more bash scripts to run, which should orchestrate the rest of the build process. As a complete newb to Docker, this has got me stumped.
The command docker run -v /path/to/dir does not accept relative paths, you should provide an absolute path. The command can be re-written as:
sudo docker run -d \
--name eluci \
-v "/$(pwd)/config/eluci.settings:/mnt/eluci.settings" \
-v "/$(pwd)/config/elucid.log4j.settings.xml:/mnt/eluci.log4j.settings.xml" \
--link eluci-database:eluci-database \
/opt/eluci/run_eluci.sh

Is the Openshift Origin Docker image production ready?

I would like to know if it is recommended to use that image in production environment. Or should I install Openshift Natively?
If I can use the docker image in production how should I upgrade it when a new version of image is released? I know I lose all configuration and application definition when starting a new docker container. Is there a way to keep them? Mapping volumes? Which volumes should be mapped?
The command line I am using is:
$ sudo docker run -d --name "origin" \
--privileged --pid=host --net=host \
-v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
-v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
openshift/origin start
PS. There is a relative question I asked yesterday but not focusing on the same problem.
Update on 20/01/2016
I have tried #Clayton's suggestion of mapping folder /var/lib/origin which worked well before 17th Jan 2016. Then I started getting Failed to mount issue when deploying router and some other applications. When I change it back to mapping /var/lib/origin/openshift.local.volumes, it seems OK until now.
If you have the /var/lib/origin directory mounted, when your container reboots you will still have all your application data. That would be the recommended way to run in a container.

Resources