retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.66k stars 366 forks source link

Problem with update while using Docker #380

Open ssbaksa opened 3 years ago

ssbaksa commented 3 years ago

Hi!

I am using Docker to build my Webvirt (it was sugestin from you or from catborise). Now I have a problem with update as it is explained at Wiki site.

root@backup:~# docker exec -it f1ed69fe0921 /bin/bash root@f1ed69fe0921:/srv/webvirtcloud# d /srv/webvirtcloud bash: d: command not found root@f1ed69fe0921:/srv/webvirtcloud# source venv/bin/activate (venv) root@f1ed69fe0921:/srv/webvirtcloud# git pull fatal: not a git repository (or any of the parent directories): .git (venv) root@f1ed69fe0921:/srv/webvirtcloud#

It looks to me that when you ignore .git directory from adding it git couldn't work any more. Line from .dockerignore **/.git

Best regards,

Saša-Stjepan Bakša

catborise commented 3 years ago

hi @ssbaksa i build new one but without your specified problem. git pull works as expected. other than that it is ideal use of containers with disposable style.

but it is sometimes unnecessary burden. i also use git pull in existing container.

ssbaksa commented 3 years ago

hi @catborise

Well, I get your point running with new image but adding each time all servers which I use is nuisance (more than 14 now). Maybe extracting database and pushing it to new image will help?

But, you say that you are pulling it in container. I have pasted lines which show failure using that method. There is no .git directory inside container. I am pasting content of my /srv/webvirtcloud directory from container. As you can see, no .git and I get error message: fatal: not a git repository (or any of the parent directories): .git

root@backup:~# docker exec -it f1ed69fe0921 /bin/bash root@f1ed69fe0921:/srv/webvirtcloud# ls -la total 400 drwxr-xr-x 1 www-data www-data 4096 Oct 20 13:56 . drwxr-xr-x 1 root root 4096 Oct 13 15:22 .. drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 accounts drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 admin drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 appsettings drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 computes drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 conf -rw-r--r-- 1 www-data www-data 26 Oct 13 15:15 _config.yml drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 console drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 datasource -rw-r--r-- 1 www-data www-data 217088 Oct 20 13:56 db.sqlite3 drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 dev drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 doc drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 .github -rw-r--r-- 1 www-data www-data 160 Oct 13 15:15 .gitpod.yml -rw-r--r-- 1 www-data www-data 6167 Oct 13 15:15 gunicorn.conf.py -rw-r--r-- 1 www-data www-data 410 Oct 13 15:15 install.sh drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 instances drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 interfaces drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 locale drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 logs -rwxr-xr-x 1 www-data www-data 631 Oct 13 15:15 manage.py drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 networks drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 nwfilters drwxr-xr-x 2 www-data www-data 4096 Oct 13 16:49 pycache drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 secrets drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 static drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 storages drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:15 templates -rw-r--r-- 1 www-data www-data 629 Oct 13 15:15 .travis.yml -rw-r--r-- 1 www-data www-data 2659 Oct 13 15:15 Vagrantfile drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:22 venv drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 vrtManager drwxr-xr-x 1 www-data www-data 4096 Oct 13 15:24 webvirtcloud -rw-r--r-- 1 www-data www-data 13249 Oct 13 15:15 webvirtcloud.sh

catborise commented 3 years ago

did you create a new build to see? i did create a new build in this morning and there is a .git folder and git pull works. may be your "cloned git directory" does not have .git folder.

ideal one is seperate db data and copy to a directory and mount it on local disk . may be we should write a wiki entry.

Maybe extracting database and pushing it to new image will help? yes. you can reach and copy it with scp.

ssbaksa commented 3 years ago

No, I didn't build it from new one. Build was done from freshly cloned repo directory. Git is definitely there.

-rw-r--r-- 1 root root 323 Oct 13 17:15 .dockerignore drwxr-xr-x 8 root root 4096 Oct 13 17:15 .git/ drwxr-xr-x 3 root root 4096 Oct 13 17:15 .github/

A mounted directory or Volume fro DB? Nice idea. I would like to see that.

Will try with copying to new image first.

ssbaksa commented 3 years ago

Now I feel stupid.

Done all from start. new repo clone, new build, start it and again, there is no .git directory in image. You can't update it, only build it from scratch.

If that's the way to do it, then it will be done that way. As you said, it is Docker way.

catborise commented 3 years ago

@ssbaksa if you want, you can remove ".git" line from ".dockerignore" then build it. it will put ".git" directory to the container. i do not know why my container contains it(normally it must not)

i am using podman(docker's rhel alternative), may be it ignores .dockerignore file.