Fossil Forum

docker-fossil: How to update fossil to current release?
Login

docker-fossil: How to update fossil to current release?

docker-fossil: How to update fossil to current release?

(1) By heribert (derhexer13) on 2019-03-15 08:54:13

I want to switch my project repos from github to local hosted fossil server.
So i will use Docker on my RAID6 NAS (Synology + Tandberg), but the current fossil version in nijtmans/docker-fossil is not 2.8.
I attempted (and failed) to update fossil in the docker-fossil to the current release 2.8. Is there any 'HowTo'?

(2) By Richard Hipp (drh) on 2019-03-15 10:35:32 in reply to 1 updated by 2.1 [link]

Fossil is a single self-contained executable file named "fossil" that is
located somewhere on your $PATH.  Simply find out where that place is
(perhaps using the command "which fossil" and replace the older executable
with a newer one.

(2.1) By Richard Hipp (drh) on 2019-03-15 10:35:50 edited from 2.0 in reply to 1 [link]

Fossil is a single self-contained executable file named "fossil" that is
located somewhere on your $PATH.  Simply find out where that place is
(perhaps using the command "which fossil") and replace the older executable
with a newer one.

(3) By heribert (derhexer13) on 2019-03-15 11:49:28 in reply to 2.1 [link]

The problem is the Docker app of the Synology NAS.
I've to download and install fossil inside the docker container. The docker container based fedora do not have installed wget. So i have to install wget. But this fails...

bash-4.3$ dnf install wget                                                                                   
Last metadata expiration check: 0:00:01 ago on Fri Mar 15 11:43:08 2019.                                     
Dependencies resolved.                                                                                       
=============================================================================================================
 Package                Arch                   Version                         Repository               Size 
=============================================================================================================
Installing:                                                                                                  
 libicu                 x86_64                 54.1-5.fc23                     fedora                  8.4 M 
 libpsl                 x86_64                 0.7.0-5.fc23                    fedora                   52 k 
 wget                   x86_64                 1.18-1.fc23                     updates                 661 k 
                                                                                                             
Transaction Summary                                                                                          
=============================================================================================================
Install  3 Packages                                                                                          
                                                                                                             
Total download size: 9.1 M                                                                                   
Installed size: 32 M                                                                                         
Is this ok [y/N]: y                                                                                          
Downloading Packages:                                                                                        
(1/3): libpsl-0.7.0-5.fc23.x86_64.rpm                                        377 kB/s |  52 kB     00:00     
(2/3): wget-1.18-1.fc23.x86_64.rpm                                           1.7 MB/s | 661 kB     00:00     
(3/3): libicu-54.1-5.fc23.x86_64.rpm                                         4.8 MB/s | 8.4 MB     00:01     
-------------------------------------------------------------------------------------------------------------
Total                                                                        3.1 MB/s | 9.1 MB     00:02     
Running transaction check                                                                                    
Transaction check succeeded.                                                                                 
Running transaction test                                                                                     
Transaction test succeeded.                                                                                  
Running transaction                                                                                          
Failed to obtain the transaction lock (logged in as: fossil).                                                
The downloaded packages were saved in cache until the next successful transaction.                           
You can remove cached packages by executing 'dnf clean packages'.                                            
Error: Could not run transaction.                                                                            
bash-4.3$

(4) By Stephan Beal (stephan) on 2019-03-15 12:00:04 in reply to 3 [link]

The error message seems to be that your user ("fossil") does not have permission to install the app. Try:

sudo dnf install wget 

Alternately, does it perhaps have curl installed instead of wget? curl can do the same things.

(5) By Stephan Beal (stephan) on 2019-03-15 12:08:10 in reply to 4 [link]

> The error message seems to be that your user ("fossil") does not have permission to install the app. 

Or that may just be my ignorance of how docker containers work. The error message is similar to the one you get on an Ubuntu system when running "apt-get install..." as a non-root user. Rather than saying "you need to be root", it complains about its inability to lock the software db.

(6) By heribert (derhexer13) on 2019-03-15 12:09:58 in reply to 4 [link]

Thx for the hint, but same problem: user 'fossil' has too few user rights.

bash-4.3$ sudo dnf install wget                                                                              
bash: sudo: command not found                                                                                
bash-4.3$ curl                                                                                               
curl: try 'curl --help' or 'curl --manual' for more information                                              
bash-4.3$ curl -O https://fossil-scm.org/index.html/uv/fossil-linux-x64-2.8.tar.gz                           
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                              
                                 Dload  Upload   Total   Spent    Left  Speed                                
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0Warning: Failed to create the f
ile fossil-linux-x64-2.8.tar.gz: Permission                                                                  
Warning: denied                                                                                              
curl: (23) Failed writing body (0 != 3860)                                                                   
bash-4.3$

(7) By Warren Young (wyoung) on 2019-03-15 13:38:41 in reply to 3 [link]

> The problem is the Docker app of the Synology NAS.

The point drh is making is that you probably don't need a whole Docker container just to run Fossil. Docker exists to bundle an app and its complex dependencies up into a bundle that will run underneath another OS, but there really aren't any dependencies in the case of Fossil, outside of things like libssl, which probably exist on the NAS already.

I'm suggesting that you might be able to build Fossil for Synology on the bare metal.

I've never developed an app for Synology, but the last time I talked to their technical sales people at a trade show, I got the impression that it's basically just a Linux box with an available SDK for cross-compiling applications. If that's still true, you don't necessarily need to involve Docker at all.

(8) By heribert (derhexer13) on 2019-03-15 14:17:22 in reply to 7 [link]

The privileges of the "Synology nas-admin" are limited. I attempted to unpack fossil via ssh (into sbin; usr/bin and usr/sbin), but all fails:

herschar@nas:/sbin$ sudo curl https://fossil-scm.org/index.html/uv/fossil-linux-x64-2.8.tar.gz | tar xvz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0fossil
100 2838k  100 2838k    0     0   911k      0  0:00:03  0:00:03 --:--:--  911k
tar: fossil: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors


I think the only way is to run fossil within a docker-container.

(9) By Stephan Beal (stephan) on 2019-03-15 14:25:17 in reply to 8 [link]

> sudo curl https://fossil-scm.org/index.html/uv/fossil-linux-x64-2.8.tar.gz | tar xvz

Running sudo that way does not do what you want. There are two problems here:

1) curl does not send its output to stdout by default, so the pipe to tar does not work.

2) The command writing to the filesystem (in this case "tar") needs permission to do write.

So, assuming 'sudo' actually does something useful on your NAS device, you'll need something like:

curl -o- http.... | sudo tar xzf -

The curl process does not need extra privileges because it's writing to stdout (-o-), but the tar process would need permission to write its output to the filesystem (and thus "sudo" to give the process root permissions).

(10) By heribert (derhexer13) on 2019-03-15 14:54:22 in reply to 9 [link]

Thx a lot - it works. 

'Installed' via SSH with:

sudo wget https://fossil-scm.org/index.html/uv/fossil-linux-x64-2.8.tar.gz | tar xzf

(11) By anonymous on 2019-03-16 17:00:14 in reply to 1 [link]

To serve Fossil repos from your NAS you don't need docker at all. Besides eating up NAS resources, it's simply a redundant layer in this case.

Have you tried downloading and running the fossil binary directly on your NAS?

If your NAS is Linux based, the pre-built version from the official site should work as is.

Fossil binary does not need root access either, you can run it from unprivileged user on NAS and serve the repos (on ports > 1024, by default it's 8080).

(12) By richard (rbucker) on 2020-05-27 13:07:35 in reply to 11 [link]

This is great news... but how is fossil configured to run as a service when it's in userspace on DSM?

thanks

(13) By Warren Young (wyoung) on 2020-05-27 16:37:02 in reply to 12 [link]

Let us first make the wild assumption that by "DSM" you mean the [Synology DiskStation Manager][1] rather than the multibillion euro multinational combine [Royal DSM][2] (first web search hit for "DSM") or the well-known [American Psychiatry Association's Diagnostic and Statistical Manual of Mental Disorders][3] (second hit). I characterize this as a wild guess because I had to scroll down to the 16th result to find it, and I made the leap only from other context in this thread.

(See how easy it is to add hyperlinks to disambiguate [TLAs][4]?)

Aaaaanyway...

I would suggest using SSH URLs in this case:

      $ fossil clone ssh://myremoteuser@mynas/museum/repo.fossil ~/museum/repo.fossil

If you really need HTTP or HTTPS cloning, then you will probably have to [build a Synology server package][5] for Fossil, because [there does not appear to be one already][6].


[1]: https://www.synology.com/en-us/dsm/6.2
[2]: https://www.dsm.com/
[3]: https://www.psychiatry.org/psychiatrists/practice/dsm
[4]: http://catb.org/jargon/html/T/TLA.html
[5]: https://www.synology.com/en-us/support/developer
[6]: https://www.synology.com/en-us/dsm/packages?group=All&search=fossil

(14) By manor (manor63) on 2022-11-16 12:58:07 in reply to 13 [link]

I found a Synology package for Fossil at:
<https://synocommunity.com/>
...that was very easy to install on my Synology.

It is version 2.17 of Fossil when I write this reply.