Docker Containers not using updated code

Hello,

I am new to using Gitlab and still trying to get used to how everything works after taking over a previous job roll where all was already set up and running so apologies if anything I say is incorrect

We have an Ubuntu server running 4 docker containers running off of a Gitlab private repository. I am updating the code within Gitlab and committing. I am then creating a new release.

I can see the Ubuntu server is looking for (‘repository’:latest), however when I attempt to pull from Gitlab or just restart my containers it still appears to be using the previous code, despite saying it has pulled the most recent version

I have used docker build -t registry… to attempt to rebuild the containers, this also hasn’t appeared to have worked.

I may well be going about this the wrong way, so any help or guidance would be appreciated

Happy to answer any questions if further clarification is needed

Thanks in advance

Hi @reventusbm
that’s exactly why you should use a versioning and not latest tag.

You have not specified where do you store the container image. Is it pushed to GitLab regsitry?

In general, if you do docker pull on the Ubuntu server, you should see it pulling the new version. You can confirm this using docker images where you can see when was the image created. It should be around time when you pushed the image to the registry.

When you have new image pulled locally, you need to stop the old containers and start new ones.

Hey @balonik

As stated before, this was all set up before so if that would be a better way to approach this I will make the change

I believe it would be pushed to a Gitlab registry.

Okay I will go and check, I will come back with any further questions if I can’t seem to get it updated

Thanks

Okay so checking back in

When pulling the image, I can see it updated however its just labelled as with the old version updated months ago below

I can only assume that isn’t meant to be the case but unsure what part I have done wrong for this to be the case

I have restarted the containers as well

Thanks