Jump to content

How to create Docker Container with a 2 stage setup process


corgan

Recommended Posts

Hello,

 

i want to make a docker app for a manictime server. The project is provided by the developers on dockerhub and works fine.

https://hub.docker.com/r/manictime/manictimeserver/

 

docker run -v /var/lib/manictimeserver/Data:/app/Data -p 8080:8080 manictime/manictimeserver

 

Thanks to the guides here in the forum, I could make a docker app in unraid from which it runs the server. No problem so far.

But to get this to work, I have to run a command first to create the admin user.

 

docker run -v /var/lib/manictimeserver/Data:/app/Data --rm --entrypoint dotnet  manictime/manictimeserver ManicTimeServer.dll addadmin -u <admin email> -p <admin password>

 

If I try to run the command from docker exec. it failed because of a locked Database. So these command have to run once bevor the server get starts.

 

/app# dotnet ManicTimeServer.dll addadmin -u [email protected] -p 1234
ManicTime server 4.2.2.0 started.
Authentication configured: Kestrel, ManicTime
Starting console host...
Connecting to database '/app/Data/ManicTimeCore.db'...
Locking database 'Sequence'...

Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]

fail: Finkit.ManicTime.Shared.Logging.ApplicationLog[0]
      Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]
Retry 1/3 in 3 seconds...
Locking database 'Sequence'...

fail: Finkit.ManicTime.Shared.Logging.ApplicationLog[0]
      Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]
Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]

Retry 2/3 in 3 seconds...
Locking database 'Sequence'...

fail: Finkit.ManicTime.Shared.Logging.ApplicationLog[0]
      Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]
Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]

Retry 3/3 in 3 seconds...
Locking database 'Sequence'...

fail: Finkit.ManicTime.Shared.Logging.ApplicationLog[0]
      Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]
Database 'Sequence' lock found and owner alive. Cannot lock database. [Finkit.ManicTime.Shared.DatabaseRegistry.DatabaseRegistryEntry]

Stopping...
Stopped listening:
ManicTime server 4.2.2.0 stopped.

 

I could run the commands on console, no problem. But I want to make this app to share as CA App.

Is it possible with the unraid docker system to get this to work, or do I have to write my own dockerfile (which i have never done and now clue about)

Link to comment
  • 5 months later...

Hi @corgan

 

Were you able to get this to work?  I'm having similar problems.  I'm sure it's user error on my part, but when I create the admin user from the unraid console, it appears to be applied to a different docker, and I need to start this extra manictime docker up via the console too.  Is there a way for me to create this admin account on the docker I install from apps/dockerhub?

 

Thanks!

Link to comment
  • 2 years later...

https://hub.docker.com/r/manictime/manictimeserver/

 

```

docker run -v /var/lib/manictimeserver/Data:/app/Data -p 8080:8080 --rm --entrypoint dotnet manictime/manictimeserver Setup.dll -publicurl

```

 

To complete the installation of manictime docker, you can do the following:

1. run the official docker command from the unraid terminal, including the “entrypoint dotnet parameter”

2. check the logs for the initialization url

3. visit the url to complete the initialization configuration

4. Re-add the docker to the unraid webui.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...