[GH-ISSUE #380] Problem with update while using Docker #240

Open
opened 2026-02-27 15:57:55 +03:00 by kerem · 6 comments
Owner

Originally created by @ssbaksa on GitHub (Oct 20, 2020).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/380

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

Originally created by @ssbaksa on GitHub (Oct 20, 2020). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/380 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
Author
Owner

@catborise commented on GitHub (Oct 21, 2020):

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.

  • git pull
  • build new image
  • run with new image

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

<!-- gh-comment-id:713348432 --> @catborise commented on GitHub (Oct 21, 2020): 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. - git pull - build new image - run with new image but it is sometimes unnecessary burden. i also use git pull in existing container.
Author
Owner

@ssbaksa commented on GitHub (Oct 21, 2020):

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

<!-- gh-comment-id:713377864 --> @ssbaksa commented on GitHub (Oct 21, 2020): 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
Author
Owner

@catborise commented on GitHub (Oct 21, 2020):

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.

<!-- gh-comment-id:713398823 --> @catborise commented on GitHub (Oct 21, 2020): 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.
Author
Owner

@ssbaksa commented on GitHub (Oct 21, 2020):

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.

<!-- gh-comment-id:713496303 --> @ssbaksa commented on GitHub (Oct 21, 2020): 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.
Author
Owner

@ssbaksa commented on GitHub (Oct 21, 2020):

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.

<!-- gh-comment-id:713518267 --> @ssbaksa commented on GitHub (Oct 21, 2020): 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.
Author
Owner

@catborise commented on GitHub (Oct 21, 2020):

@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.

<!-- gh-comment-id:713574536 --> @catborise commented on GitHub (Oct 21, 2020): @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#240
No description provided.