week of 24 september

24 Sep 2018

recap

This is a continuation of an ongoing series of work logs following my journey to dockerize my people counter raspberry pi app. I feel like I’m almost done with it, but every day is a new discovery of things I didn’t know I needed to do, followed by figuring out how to do those things. Follow along if you like, and feel free to go back through the annals of time:

24 sep

It’s been a weird kind of Monday. I just started reading up on the --env-file flag and it’s already 6:40pm, so this is probably all that will happen tonight.

Just found out that .env files only work with Docker compose. Which I don’t want to add to my repertoire right now. So it looks like we’ll be going with -e commands during docker run. sigh

25 sep

Today will be reimaging the SD card and seeing what happens when I pull down the current docker image.

Following the “instructions” I wrote starting 15 august:

What I suspect will need to happen:

I’ll need to do this again after testing the docker pull!

Had a weird error when I tried to run the container: error response from daemon: failed to create endpoint on network bridge. After a reboot, I had no problem.

The docker image is not updated. So I need to push the new docker image with the updated Dockerfile and extra javascript file. Then try this all again.

Made the necessary updates, then rebuilt the docker image and pushed to docker hub:

Just tested pulling and running the image, and it’s working! Now I just need to update the image so the POST_PATH variable doesn’t default to my API. Maybe there’s a way to have the error message reflect that it needs an updated variable?

Went ahead and backed everything up. Both the tester SD card and my original dev SD card. I’m going to set up the pi in break room again for further testing. This is about as far as I can go without doing further testing.

I’ll flash Jonathan’s SD card with this latest version and send it his way with some basic instructions.

And so it begins!

26 sep

I forgot I still need to write that bash script for running the docker container on startup. Today’s to-dos:

Tried a thing, and it seems to be working:

After I logged in and opened the terminal, it seems to be running. docker ps shows that it’s just the one container running, so that’s good news. Because I can’t help myself, I’m going to try another method and see how that one works.

Well, that didn’t work. I tried editing /etc/rc.local but on reboot, no container was running. So I reverted to the above.

New question: should I have the script pull the latest version of the image?

Time to re-backup the SD card and write some documentation!

27 sep

Taking a break from raspi-ing today and doing some treehouse node.js learnin’. It’s been a while!

If I think about it later today, I’ll flash Jonathan’s SD card. I keep thinking of other things I should add to the image, but at some point, this just needs to be tested.

Current to-do list: