IOTstack icon indicating copy to clipboard operation
IOTstack copied to clipboard

how to retrive an old image

Open pvklink opened this issue 3 years ago • 5 comments

HI, i use iotstack for two months now and very exited. I made my own menu for creating the compose file etc. based on my own composed parts and dockerfiles I use only the docker commands in the menu from iotstack. I mainly execute dockerimages with tag "latest". Some questions:

But what if the latest image isnt ok,!

  • do i have the previous image, where can i find this. I tried docker images and a search on my disk but no images
  • which data did i had to backup and must i restore when activating this previous image
  • how does this work in the menus from iotstack...

pvklink avatar Jun 17 '21 12:06 pvklink

Please see THIS PROJECT IS DORMANT.

To answer your question…

Option 1 - the DockerHub image is running

Look in your docker-compose.yml.

Suppose you see:

  grafana:
    container_name: grafana
    image: grafana/grafana:latest

The "image" is telling you that the grafana image comes straight from DockerHub.

If you want to pin Grafana to, say, version 7.5.7, change that image line to be:

    image: grafana/grafana:7.5.7

and then do:

$ docker-compose up -d grafana

The version 7.5.7 image will be pulled down from DockerHub, a new container will be instantiated, and the old container discarded.

Option 2 - a local image is running

Look in your docker-compose.yml.

Suppose you see:

  nodered:
    container_name: nodered
    build: ./services/nodered/.

The "build" tells you a Dockerfile is involved. A base image is pulled down from DockerHub, the Dockerfile runs to produce a local image, and the local image is what runs.

The leading "." means "the directory containing docker-compose.yml" and the trailing "." means Dockerfile so the path you need is:

~/IOTstack/services/nodered/Dockerfile

The start of that Dockerfile is:

FROM nodered/node-red:latest-12

You need to go to the DockerHub tags page to figure out what to do next.

The current version of Node-RED is "1.3.5" and the "-12" suffix is talking about the version of NodeJS. To roll back to version 1.3.4 with the same NodeJS:

FROM nodered/node-red:1.3.4-12

then do:

$ docker-compose up -d --build nodered

Hope that helps.

Paraphraser avatar Jun 17 '21 14:06 Paraphraser

Thank Paraphraser, A lot om my composefiles or dockerfile refer to for example:domoticz/domoticz:latest https://hub.docker.com/r/domoticz/domoticz/tags?page=1&ordering=last_updated

When this image is not ok, i want the previous. i dont see any other images on that site. Alternative is to save the image that worked before. I use IOTstack, so i am searching for the datastorage to save it from there. I hoped that the docker images command and the show image id would help, but it does not...

pvklink avatar Jun 17 '21 15:06 pvklink

The docker images command just lists the images available on your local computer.

I see what you mean about demoticz/demoticz. Unfortunately, docker and docker-compose can only pull what is available on DockerHub. Most image maintainers understand that, sometimes, users may need to revert to older versions, so they only ever add to DockerHub and never remove. The person maintaining demoticz/demoticz is not playing the game in a user-friendly manner.

But I have a question for you. Why are you using domoticz/domoticz instead of linuxserver/domoticz?

The SensorsIot/IOTstack template for domoticz refers to linuxserver/domoticz while gcgarner/IOTstack doesn't even have a template for domoticz.

There are only two reasons why people open issues on gcgarner/IOTstack:

  1. They are actually using SensorsIot/IOTstack but went to gcgarner by mistake.
  2. They are still using gcgarner and haven't realised that it stopped being maintained 18 months ago.

If you really are using gcgarner/IOTstack then it is probably time to migrate over. See the migration instructions.

Unless there is some good reason why you must use domoticz/domoticz rather than linuxserver/domoticz, I think you'll find that the people behind linuxserver/domoticz are playing the DockerHub game correctly. They keep all the back versions there (43 pages' worth going back 4 years). 10 million pulls indicates a lot of happy users.

domoticz/domoticz just has the one version on DockerHub. 100K pulls is also not a small number so I'm not trying to suggest there's anything "wrong" with domoticz/domoticz. I'm just pointing out that linuxserver/domoticz will give you the ability to roll backwards and the 10M pulls can give you a fair bit of confidence that it will work.

But it's your system and your decision.

Paraphraser avatar Jun 18 '21 01:06 Paraphraser

Thanks! Just new in the world of docker! So i started with an install of IOTstack, to make a flying start. After two months i have all my functionallity installed with docker. No idea if a have gcgarner or sensorlot version, where can i see that ? I use the domoticz/domoticz because i was ona beta version with my environment and linuxserver did not publish beta's If linuxserver is better and also has the beta's, i will change!

pvklink avatar Jun 18 '21 06:06 pvklink

i have the sensorsIOT!

I have domoticz Version: 2021.1 (build 13314) running on my rpi Let say, i got a crash and saved my data,thats on 13314). Is there a linuxserver/domoticz image thats fitting my data when crashing... It is hard to find the buildspecification in linuxserver/domoticz

pvklink avatar Jun 18 '21 06:06 pvklink