Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run in a docker image using the supplied docker-compose.yml file on a Raspberry Pi 4 #296

Open
andrewcliffoutlook opened this issue Feb 10, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@andrewcliffoutlook
Copy link

I have clone your git repo locally to my Raspberry Pi and updated the docker-compose.yml file with a required rail token and then run sudo docker-compose up -d which then builds the docker image by pulling a .net SDK 6 base image and then running the build process followed by pulling a aspnet image and copying the binaries from the build image. This all works fine. However when the process completes and the docker image starts it fails to start with following error in the logs:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly '/DepartureBoardWeb.dll'. The system cannot find the file specified.
File name: '/DepartureBoardWeb.dll'

I have run the command sudo docker export departureboard-departure-board-1 | tar t > my-container-files.txt and on viewing the output txt file I can see that the DepartureBoardWeb.dll file does exist.

Any help on how I can fix this issue and run this locally on my Raspberry Pi on a docker image.

@andrewcliffoutlook andrewcliffoutlook added the bug Something isn't working label Feb 10, 2024
@benfl3713
Copy link
Owner

Hi @andrewcliffoutlook

Thanks for raising this, I think your the first person to try run it in docker on a raspberry pi.
If I was to guess, it's because a raspberry pi is ARM64 rather the X64 then it doesn't build it in docker correctly.

The good news it the code fully supports ARM64 it's just I haven't added support for it within docker. I shall try and add an extra config specifically for building it on a raspberry pi

@andrewcliffoutlook
Copy link
Author

@benfl3713 thank you. If there is any additional information I can send you that will highlight what config changes are needed please let me know

@benfl3713
Copy link
Owner

I've fixed this for you now. Turned out to be a very odd problem with paths working differently on the RPI.
I've tested it on my Pi5 and it is building a running fine now.

You'll need to git pull to get the changes I've made.
And then you'll need to rebuild the docker container with sudo docker-compose build

@andrewcliffoutlook
Copy link
Author

@benfl3713, thank you. That is working now. Whilst I can now run a local view by providing my local station via a querystring parameter I note that the system doesn't work completely as a local docker container. For example you cannot goto to the admin section as that points at admin.leddepartureboard.com and you cannot login, the google login doesn't work (I expect this is because you need to be running this as a https site rather than http). How would we get this to run completely local?

I also note from logs coming from the docker container that you need more than realtime train token details, it says you need nationalrail login details. Would you consider documenting how you apply for these and what the entries in the config file should look like.

@benfl3713
Copy link
Owner

I think to run it locally I just need to add the url into a whitelist. What port are you running it on, guessing it's 9005? And are you accessing it via http://localhost:9005 or are you referencing it remotely such as http://raspberrypi:9005

@benfl3713
Copy link
Owner

And yes, for things like searching for a station, it requires national rail login. I can provide some information on how to obtain this info

@andrewcliffoutlook
Copy link
Author

And yes, for things like searching for a station, it requires national rail login. I can provide some information on how to obtain this info

Hi @benfl3713 please could you send me details on how I do this as when you run this locally the code runs through a process which ideally would have these details and it means the code performs much slower then it does on your leddeparturesboard.com site

@benfl3713
Copy link
Owner

Hi @andrewcliffoutlook
I have added the following guide to the repo: https://github.com/benfl3713/DepartureBoard/blob/master/RUNNING_LOCALLY.md

I'm recalling from memory, so if you experience something different or need any help, let me know and I can update the guide with more info

@benfl3713
Copy link
Owner

Note the api your probably interested in setting up is the National Rail Knowledge API

@andrewcliffoutlook
Copy link
Author

@benfl3713, thank you for putting up the instructions. You have been super responsive and shown how open source code can really work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants