Post A0E7FOe6BMftaSff0a by urusan@fosstodon.org
(DIR) More posts by urusan@fosstodon.org
(DIR) Post #A0BpszbAXWifzr705I by paladin@fosstodon.org
2020-10-14T19:35:20Z
0 likes, 0 repeats
I feel completely stupid. Tried to use Docker to install (run) an app on my linux machine. I failed. The story should've had a happy ending with localhost:8080/libreplan leading me to libreplan screen. It didn't happen. Is there a nice tutorial about using docker to run apps? It has to be very simple. Something like Docker for Dummies but dumber. Way dumber.
(DIR) Post #A0BpszpLgo3uhpkKBc by blueberry@fosstodon.org
2020-10-14T22:03:05Z
0 likes, 0 repeats
@paladin make sure you’re opening ports (docker run -p 8080 image) and/or your firewall isn’t blocking it
(DIR) Post #A0Bpt04am8FtT6sUwi by paladin@fosstodon.org
2020-10-15T14:46:35Z
0 likes, 0 repeats
@blueberry Still nothing
(DIR) Post #A0Bpt0LxjY9MKz0N1M by urusan@fosstodon.org
2020-10-15T15:25:54Z
0 likes, 0 repeats
@paladin @blueberry Where did the 1 in mariadb1:db come from?I see you're following the directions here:https://hub.docker.com/r/libreplan/libreplan/I'm also unsure how libreplan expects port 8080 to be exposed when they don't forward it
(DIR) Post #A0BqAwtPL3dMojCmXI by urusan@fosstodon.org
2020-10-15T15:29:02Z
0 likes, 0 repeats
@paladin @blueberry You might try adding "-p 8080:8080" to the second command to fix that specific thing.When you run these commands, does anything show up with "docker container ls"? Can you use "docker logs [docker-name]" to see the logs?
(DIR) Post #A0BqMKdtNUiRf3NMMy by urusan@fosstodon.org
2020-10-15T15:31:16Z
0 likes, 0 repeats
@paladin @blueberry I just looked at their provided docker compose file and they messed up their instructions!The parameters in this file are correct:https://github.com/LibrePlan/docker-images/blob/master/1.4.1-mysql/docker-compose.yml
(DIR) Post #A0BuNggFKIf07JNXQO by paladin@fosstodon.org
2020-10-15T16:16:19Z
0 likes, 0 repeats
@urusan @blueberry :) maria1 came because I didn't kill maria. Now there is maria2 even. :D Thank you very much for your help! I will try to set this up a bit later and let yku all know how it went.
(DIR) Post #A0BwirfPsDEWBHDTHc by urusan@fosstodon.org
2020-10-15T16:42:29Z
0 likes, 0 repeats
@paladin @blueberry By the way, posting what you were using really helped. It made it a lot easier to pinpoint what was going on.I saw your post yesterday but was too busy to help properly between work and childcare, but with it being vague I didn't have much to go on.Let us know if you hit another roadblock. It sounds like you are making good progress though. :)
(DIR) Post #A0E5q7gpzEkBo1KwXg by paladin@fosstodon.org
2020-10-16T17:34:03Z
0 likes, 0 repeats
@urusan @blueberry Ok, that is one thing solved.Let see if I got other instructions right:1. Use docker-compose file - ok2. and the sql install script . don't know how to3. Launch a mariadb container - ok4. Launch and attach libreplan container - Error
(DIR) Post #A0E7FOe6BMftaSff0a by urusan@fosstodon.org
2020-10-16T17:49:56Z
0 likes, 0 repeats
@paladin @blueberry There's an implicit or there:1. docker-compose2. SQL install scriptOR1. Setup db2. Setup and connect libreplan3. Presumably run SQL install script
(DIR) Post #A0E7ROck5bf4zhl5Bg by urusan@fosstodon.org
2020-10-16T17:52:02Z
0 likes, 0 repeats
@paladin @blueberry The error is because the container is already set up and running from the docker-compose step. The original container is taking up the port.But it's simple to fix, just don't use "docker run" at all.
(DIR) Post #A0E83XGAQhqSmYNwqO by urusan@fosstodon.org
2020-10-16T17:58:52Z
0 likes, 0 repeats
@paladin @blueberry As for how to run that SQL install script...it's weird that they're asking you to do that, especially since they are using Liquibase.For anyone not familiar with Liquibase, it's a Java library to set up a database schema automatically. It uses a cross-db schema definition language. The setup SQL is the final product of running liquibase (for MySQL).The mainstream paradigm is that if your liquibase-using program starts up and finds an empty database, it should set it up.
(DIR) Post #A0E8ElGah1jdPPw78K by urusan@fosstodon.org
2020-10-16T18:00:14Z
0 likes, 0 repeats
@paladin @blueberry Sorry, wait, they ran it on postgres, not MySQL or MariaDB.
(DIR) Post #A0E8jNQ7P37AQazWUa by urusan@fosstodon.org
2020-10-16T18:06:32Z
0 likes, 0 repeats
@paladin @blueberry Here's what you would run against a MySQL or MariaDB database to set it up:https://github.com/LibrePlan/docker-images/blob/master/1.4.1-mysql/sql/1.4.1.sqlIt's just plain SQL/DDL, so you just need to run the script against the database. There's a variety of ways to do this. For each database there's a command line utility to run SQL, there's usually a nice GUI tool, and many have a website associated with the database that you can navigate to. There's also some generic tools for this, but I don't know what is good.
(DIR) Post #A0E94QEu7IYJFimUgy by paladin@fosstodon.org
2020-10-16T18:10:17Z
0 likes, 0 repeats
@urusan @blueberry There are two options... postgres or mysql (or mariadb...) I'd be happy with the one that works :)
(DIR) Post #A0E96RxYgxXpAPdQ9I by urusan@fosstodon.org
2020-10-16T18:10:44Z
0 likes, 0 repeats
@paladin @blueberry That said, there's a good chance that their documentation is misleading about this whole "needing to run a SQL setup script" thing and Liquibase will just handle it for you on startup.If I were you, I would just clean everything back to square one, run docker-compose again like you did last time, and then just navigate to the site to see if it worked automatically.If that fails, then go see if the database is the issue and if you need to run that script.
(DIR) Post #A0E9HXKh3TFn16k65Y by urusan@fosstodon.org
2020-10-16T18:12:43Z
0 likes, 0 repeats
@paladin @blueberry If you go with Postgres and have to run the install script, I know that this tool is good for mucking around with the database https://www.pgadmin.org
(DIR) Post #A0E9Jmjel8oTMmUUnQ by paladin@fosstodon.org
2020-10-16T18:13:07Z
0 likes, 0 repeats
@urusan @blueberry What is the easiest database to learn from those mentioned here?
(DIR) Post #A0E9VcYMRTuLGIqq5w by urusan@fosstodon.org
2020-10-16T18:15:13Z
0 likes, 0 repeats
@paladin @blueberry MariaDB seems to have a long list of generic db tools https://mariadb.com/kb/en/graphical-and-enhanced-clients/Also, don't forget the command line tools, especially since they can be scripted.
(DIR) Post #A0E9ukmOzesM11P3Hk by urusan@fosstodon.org
2020-10-16T18:19:48Z
0 likes, 0 repeats
@paladin @blueberry Postgres is more modern and fully featured. I would recommend it if you want to learn more about databases. I'd also recommend it if you don't care and it's an option.MySQL and MariaDB are more common, but also more old fashioned and idiosyncratic. Also, the split is because Oracle acquired MySQL.Really it doesn't matter all that much though, databases are usually used behind abstraction layers.
(DIR) Post #A0EDM9CkaczDRvTu8e by paladin@fosstodon.org
2020-10-16T18:57:38Z
0 likes, 0 repeats
@urusan @blueberry Thank you for the help!
(DIR) Post #A0EEKqDZnQYWEBoCMS by urusan@fosstodon.org
2020-10-16T19:09:20Z
0 likes, 0 repeats
@paladin @blueberry No problem
(DIR) Post #A224sctNg6xibXXjtI by paladin@fosstodon.org
2020-12-09T18:11:02Z
0 likes, 0 repeats
@urusan @blueberry Hi ... I can't work this out... It is like there is always: use docker compose or do it manually ... https://github.com/LibrePlan/docker-images/issues/6
(DIR) Post #A226XFOu1YMjZdDkI4 by urusan@fosstodon.org
2020-12-09T18:29:35Z
0 likes, 0 repeats
@paladin @blueberry Are you the user who created that issue on github?If so, it looks like the problem was that the database was not initialized.So, the opposite of what I was thinking earlier, good to know.
(DIR) Post #A227COdIbUdo50ZlOi by urusan@fosstodon.org
2020-12-09T18:37:02Z
0 likes, 0 repeats
@paladin @blueberry Does your local "/absolute/path/to/folder/sql" exist and contain install.sql?If so, is it the postgres version of install.sql?
(DIR) Post #A22CAKWhOrUgXGK4kC by paladin@fosstodon.org
2020-12-09T19:32:42Z
0 likes, 0 repeats
@urusan @blueberry No I am not.
(DIR) Post #A22CJWqwwINPN8BIRc by paladin@fosstodon.org
2020-12-09T19:34:22Z
0 likes, 0 repeats
@urusan @blueberry Where is "absolute path"?This is my docker compose file:db: container_name: db image: mysql:5 ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: my-secret-pw MYSQL_DATABASE: libreplan MYSQL_USER: libreplan MYSQL_PASSWORD: secret volumes: - "./sql:/docker-entrypoint-initdb.d"web: container_name: web image: libreplan/libreplan:1.4.1-mysql ports: - "8080:8080" links: - db
(DIR) Post #A22CNJ3oA5hVklzryS by paladin@fosstodon.org
2020-12-09T19:35:02Z
0 likes, 0 repeats
@urusan I also got the install.sql file in the same folder as docker-compose.yml file
(DIR) Post #A22CT45ajmFb3gZpom by paladin@fosstodon.org
2020-12-09T19:36:05Z
0 likes, 0 repeats
@urusan If I understod correctly I can go with docker compose and use the install.sql file or manually create two containersIs this so or?
(DIR) Post #A22D1V0n97zUP3keFU by urusan@fosstodon.org
2020-12-09T19:42:18Z
0 likes, 0 repeats
@paladin So, with your current docker-compose file, it's mounting the ./sql folder (which is supposed to have install.sql inside it) into a folder in your database, which will autorun on (first) startup../sql is going to be the sql folder inside whatever directory you run `docker-compose up` from.So, it sounds like you just need to make a sql folder to put the install.sql file into, so it can be mounted properly.
(DIR) Post #A22DPVPNK7naaChI9Y by urusan@fosstodon.org
2020-12-09T19:46:38Z
0 likes, 0 repeats
@paladin It's also possible to mount a single file, if you give the full path of the file on both sides of the mount definition:./install.sql:/docker-entrypoint-initdb.d/install.sqlThat would mount just the install.sql file from the current directory into that folder.
(DIR) Post #A22DeiBq5GHkZIcITY by urusan@fosstodon.org
2020-12-09T19:49:22Z
0 likes, 0 repeats
@paladin Oh, and yes, both of those are viable options.Manually creating 2 containers would require install.sql btw.That said, another option is to make a Dockerfile that loads install.sql permanently into the database image.I would personally go with docker-compose though.
(DIR) Post #A22E77rCFQisHWVgvY by paladin@fosstodon.org
2020-12-09T19:54:30Z
0 likes, 0 repeats
@urusan OK ... I did it and again the same message:HTTP Status 404 - /libreplantype Status reportmessage /libreplandescription The requested resource is not available.Apache Tomcat/7.0.68
(DIR) Post #A22EOyJ6UcDBsM4aye by urusan@fosstodon.org
2020-12-09T19:57:43Z
0 likes, 0 repeats
@paladin What does `docker logs web` say?
(DIR) Post #A22ES1vbUEJByUXVj6 by paladin@fosstodon.org
2020-12-09T19:58:18Z
0 likes, 0 repeats
@urusan
(DIR) Post #A22EXfZNWmUiMuphg0 by urusan@fosstodon.org
2020-12-09T19:59:18Z
0 likes, 0 repeats
@paladin Also, can you connect to the database and is it full of schema?This is the easiest tool to use:https://www.pgadmin.org
(DIR) Post #A22Eb26uB6u1987PoO by paladin@fosstodon.org
2020-12-09T19:59:56Z
0 likes, 0 repeats
@urusan It says a lot... how can I export commant output to file?
(DIR) Post #A22EdK9I5BBVfeKKFE by urusan@fosstodon.org
2020-12-09T20:00:20Z
0 likes, 0 repeats
@paladin Oh wait, you are using mysql after all. I assumed you were using postgres
(DIR) Post #A22EhnYMhQpY1dBlHk by urusan@fosstodon.org
2020-12-09T20:01:09Z
0 likes, 0 repeats
@paladin `docker logs web > file.txt`
(DIR) Post #A22EoQFRkIuFlyUxMG by urusan@fosstodon.org
2020-12-09T20:02:20Z
0 likes, 0 repeats
@paladin Also useful is `docker logs web | less`
(DIR) Post #A22FRX4eIkA6Ej64hc by urusan@fosstodon.org
2020-12-09T20:09:23Z
0 likes, 0 repeats
@paladin By the way, you might also want to look at `docker logs db` to see what the database said while it was starting up.
(DIR) Post #A22Fc5D6EpW70K53fk by urusan@fosstodon.org
2020-12-09T20:11:18Z
0 likes, 0 repeats
@paladin Also, be aware that a heavyweight Java service in a Tomcat container could take several minutes to start up, so if you don't find any errors in the logs it's worth checking if the page came online on its own.
(DIR) Post #A22G6F73z7oGP7ddsu by urusan@fosstodon.org
2020-12-09T20:16:47Z
0 likes, 0 repeats
@paladin One last quick tip:`docker logs -f web` will follow the log output of the web container, so you can see what's happening in real time.Extra long logs can also benefit from the "-t 20" option (print out tail of just last 20 lines).You can always tail the output of any command using `command | tail -n 20`
(DIR) Post #A22G8cAhDz3oUxT7SK by paladin@fosstodon.org
2020-12-09T20:17:13Z
0 likes, 0 repeats
@urusan Will do. back to square one...
(DIR) Post #A22GkWJTSEPXKheJOq by urusan@fosstodon.org
2020-12-09T20:24:00Z
0 likes, 0 repeats
@paladin By the way, I just noticed your database died. Any idea why it died?Of particular importance is making sure you fed it the right install.sql. The postgres version is in a different dialect and thus won't be understandable to a MySql database.
(DIR) Post #A22H5iaF1oZxTDbFxo by paladin@fosstodon.org
2020-12-09T20:27:52Z
0 likes, 0 repeats
@urusan Hahaha... my database died ... I have no idea it was alive in the first place :D
(DIR) Post #A22H7K1dJ2JVsqB1u4 by urusan@fosstodon.org
2020-12-09T20:28:10Z
0 likes, 0 repeats
@paladin Here's the file that needs to get into the database https://github.com/LibrePlan/docker-images/tree/master/1.4.1-mysql/sql
(DIR) Post #A22HMgWNwsZfztt20W by paladin@fosstodon.org
2020-12-09T20:30:55Z
0 likes, 0 repeats
@urusan Thank you for all your help. I will try with the file you gave me and get back to you. My better half took the laptop so it will take a while... :)
(DIR) Post #A22JE5t8Sv9FyQYjKa by urusan@fosstodon.org
2020-12-09T20:51:48Z
0 likes, 0 repeats
@paladin Good luck, let me know the results. :)
(DIR) Post #A22OLx6fV0WmpDSIwS by paladin@fosstodon.org
2020-12-09T21:49:13Z
0 likes, 0 repeats
@urusan I finally did it! :)Or you made me finally do it. Where did I go wrong...Well among other things, when I wanted to download docker-compose.yml and install.sql files I could click on their link and then copy/paste. Since the install.sql is a big file, save link as and copy paste looked quite similar. Both huge. Finally I realized that copy paste from the page is not the same file as save link as... I feel really stupid now.
(DIR) Post #A22OqTjkkDz8iKIEXQ by urusan@fosstodon.org
2020-12-09T21:54:45Z
0 likes, 0 repeats
@paladin That's great to hear you got it working!The important thing is to see things through, even when the going gets tough, it's the best way to learn hard skills.After all, not only did you get it working, but you also learned additional troubleshooting skills on the way.