# When to upgrade docker (and how)?

**URL:** https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989
**Category:** Support
**Created:** [May 8, 2018, 11:40am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989 "2018-05-08T11:40:02Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [May 8, 2018, 11:40am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/1 "2018-05-08T11:40:02Z")

</div>

Continuing the discussion from [Docker using a lot of CPU](https://meta.discourse.org/t/docker-using-a-lot-of-cpu/76788/6):

> [@Docker using a lot of CPU](https://meta.discourse.org/t/docker-using-a-lot-of-cpu/76788/6):
>
> \> Looks like one should be rather conservative in upgrading docker?
> 
> Being conservative in upgrading docker isn’t even enough; we follow that policy (still on 17.06), and we _still_ got hit by [a ripper of a bug](https://github.com/moby/moby/issues/35757) that exists in all versions from 17.06 to 17.11 (and, by the glacial pace at which the PR is moving, will probably be in 18.01 or whatever the next release will be).
> 
> Basically, Docker’s gonna Docker, and all we can do is hang on for the ride and try and dodge the worst of the low-hanging tree branches.

I had made a mental not that I’ll eventuall need to allow my instance to upgrade docker again, after downgrading because of that bug, but I’m not sure when I should do that nor how I do it without breaking stuff… Or do I need to do anything?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 8, 2018, 12:50pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/2 "2018-05-08T12:50:00Z")

</div>

Is 17.06 still the recommended? We’re on 17.10.0-ce ourselves.

If you’ve installed via apt it’s relatively straightforward, uninstall, reboot:

```
sudo apt-get autoremove -y docker-ce \ 
& sudo apt-get purge docker-ce -y \ 
& sudo rm -rf /etc/docker/ \ 
& sudo rm -f /etc/systemd/system/multi-user.target.wants/docker.service \ 
& sudo rm -rf /var/lib/docker \ 
& sudo systemctl daemon-reload 

```

then use:

```
sudo apt-cache policy docker-ce

```

to see which versions are available to apt, and then:

```
sudo apt-get install -y docker-ce=[build string]

```

to install a specific version.

Checking our install we can see builds ranging from 17.04.0-ce all the way up to 18.04.0-ce:

```
 docker-ce:
  Installed: 17.10.0~ce-0~ubuntu
  Candidate: 18.04.0~ce~3-0~ubuntu
  Version table:
     18.04.0~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     18.03.1~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     18.03.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     18.02.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     18.01.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.12.1~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.12.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.11.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
 *** 17.10.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
        100 /var/lib/dpkg/status
     17.09.1~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.09.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.07.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.06.2~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.06.1~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.06.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.05.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.04.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages

```

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [May 8, 2018, 12:52pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/3 "2018-05-08T12:52:27Z")

</div>

We’re on version 18.04.0-ce, build 3d479c0 across at least 5 known good instances. Haven’t had any issues due to docker yet!

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 8, 2018, 1:12pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/4 "2018-05-08T13:12:09Z")

</div>

> [@itsbhanusharma](#):
>
> Haven’t had any issues due to docker yet!

Pretty much a guaranteed way to jinx your installs!

Seriously though, over the past few years we’ve had a number of run-ins with docker versions. Even if instances appear to be building and running ok there have been plenty of performance issues between versions.

Running doesn’t necessarily mean running well.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [May 8, 2018, 1:16pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/5 "2018-05-08T13:16:19Z")

</div>

I’d totally agree to that, There have been multiple edge cases and other complaints due to people being on a specific version of docker which contains some bug. About the performance part, I haven’t really invested myself into creating stats for known good and the delta between those and the latest so I can’t say much but I never had it trigger any alerts for me.

I’m however curious to know what strategy you use to observe the performance metrics for docker in relation to discourse?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 8, 2018, 1:19pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/6 "2018-05-08T13:19:21Z")

</div>

Usually the difference is observable from whatever server management you use, we’ve got everything in either AWS or DO and most of it is hooked up into New Relic. If there’s a performance difference there’s also usually an observable step up or down in CPU usage.

We’ve not gone so far as to look at transaction times, but as these machines only run Discourse it’s very easy to see if a docker version has an impact on load.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 8, 2018, 11:59pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/7 "2018-05-08T23:59:52Z")

</div>

I would use latest Docker unless you have specific reasons not to.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [May 9, 2018, 3:37am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/8 "2018-05-09T03:37:58Z")

</div>

Well, @mpalmer seemed to think differently, and he seemed to suggest that that is not what you’re doing:

> [@Docker using a lot of CPU](https://meta.discourse.org/t/docker-using-a-lot-of-cpu/76788/6):
>
> we follow that policy (still on 17.06)

But okay. So my question then is: is there still a reason not to use the latest version?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [May 9, 2018, 4:25am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/9 "2018-05-09T04:25:02Z")

</div>

I provide insights into our environment, processes, and decision-making for informational purposes _only_, unless clearly stated otherwise. What we at CDCK do, given our scale, priorities, and the skills and experience of our team, is not necessarily a good idea for everyone else, whose circumstances are likely very different. That’s the “unless you have specific reasons not to” in Jeff’s post.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [May 9, 2018, 5:09am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/10 "2018-05-09T05:09:47Z")

</div>

Yes, I understand. I was just wondering whether such reasons currently exist.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [May 9, 2018, 8:43pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/11 "2018-05-09T20:43:22Z")

</div>

I’d interpret that as “specific reasons that your installation of Discourse is different from ‘Most’ installations of Discourse”. Or “you should already know if this applies to you” or “your sysadmin said you need to hold back the upgrade” or …

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [May 9, 2018, 10:16pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/12 "2018-05-09T22:16:49Z")

</div>

> [@riking](#):
>
> your sysadmin said you need to hold back the upgrade

Well, something like that happened [back then](https://meta.discourse.org/t/docker-using-a-lot-of-cpu/76788). But I guess the reasons for being more than conservative with docker upgrades that existed some months ago don’t exist anymore. Otherwise we’d have heard them by now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 9, 2018, 10:21pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/13 "2018-05-09T22:21:49Z")

</div>

For example. All our internal stuff is wedded deeply to ipv6. It turns out the rest of the world barely uses ipv6, apparently, because Docker had a release where it blew away all ipv6 routing (which caused a massive internal hosting outage for us), and we were basically the _only_ people to report it as a problem. It still isn’t fixed as far as we know.

There’s a concrete, very specific example of how “the world” and “discourse internal” can deviate.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [May 9, 2018, 10:57pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/14 "2018-05-09T22:57:34Z")

</div>

> [@tophee](#):
>
> I guess the reasons for being more than conservative with docker upgrades that existed some months ago don’t exist anymore.

Having some doubts now that I found the time to take a closer look. The reason why Matt [recommended to downgrade and to lock your docker Version back](https://meta.discourse.org/t/discourse-web-interface-becomes-unresponsive-a-few-minutes-after-starting/76643/14) in December was this bug in docker:

[https://github.com/moby/moby/issues/35865](https://github.com/moby/moby/issues/35865)

And from what I can tell, it has still not been entirely fixed. So I suppose it’s saver too stick to version 17. 10 for now…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 9, 2018, 10:59pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/15 "2018-05-09T22:59:54Z")

</div>

You’d only run into that with _very_ badly behaved inputs though, we were triggering it with some weirdness on our end, which we resolved.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [May 9, 2018, 11:08pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/16 "2018-05-09T23:08:31Z")

</div>

> [@codinghorror](#):
>
> It still isn’t fixed as far as we know.

The IPv6 one got fixed, it just missed the next stable release which was frustrating, since we needed to roll custom packages with the bugfix. It’s all the _other_ ones that are still open. The “logging long lines” bug hasn’t even been substantively looked at, as far as I can tell, however we deployed a workaround that shouldn’t cause it to trip when running Discourse. I wouldn’t call wanting to write your logs to Docker “badly behaved”, though, since that’s what Docker’s supposed to be for (“ill-advised”, yes, but not badly behaved).

---

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [August 1, 2018, 4:42am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/17 "2018-08-01T04:42:32Z")

</div>

What is not covered here is the “how” part.

Currently, according to app-cache, I have docker-engine installed:

> docker-engine/ubuntu-trusty,now 17.05.0~ce-0~ubuntu-trusty amd64 [installed]

and I get the warning

> WARNING: Docker version 17.05.0-ce deprecated, recommend upgrade to 17.06.2 or newer.

However the [Get Docker CE for Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) instructions start with “Uninstall old versions `docker` or `docker-engine`” before installing docker-ce.

Needless to say, anything that starts with “uninstall stuff” makes me more than a little nervous as to how much of my site it plans on deleting, and how safe it is to go ahead and uninstall docker-engine, and then install docker-ce, and expect my site to be there and working when I finish. How safe is this process? If I have a site working with docker-engine, and I follow the `Get Docker CE for Ubuntu` instructions, uninstall docker-engine, install docker-ce via the “Install using the repository” instructions, am I likely to actually have a working site at the end of it?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 1, 2018, 4:43am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/18 "2018-08-01T04:43:24Z")

</div>

It is quite safe since the container file is not touched.

---

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [August 1, 2018, 6:13am UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/19 "2018-08-01T06:13:43Z")

</div>

OK, followed the instructions and it all went smoothly. The most time consuming part by far was taking a snapshot beforehand as a safety precaution (on top of normal backups and such).

`docker info` now reports:

> Server Version: 18.06.0-ce  
> Storage Driver: aufs

I include the aufs since the update `Get Docker` page says:

> For Ubuntu 16.04 and higher, the Linux kernel includes support for OverlayFS, and Docker CE uses the `overlay2` storage driver by default. If you need to use `aufs` instead, you need to configure it manually. See [aufs](https://docs.docker.com/engine/userguide/storagedriver/aufs-driver/)

But it seems that the update did not transition to using overlay instead of aufs.

Do I need to do something to make that happen as well, or just ignore it and continue with aufs?

Thanks!

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [January 12, 2020, 11:41pm UTC](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989/20 "2020-01-12T23:41:22Z")

</div>

> [@Stephen](#):
>
> then use:
> 
> ```plaintext
> sudo apt-cache policy docker-ce
> 
> ```
> 
> to see which versions are available to apt, and then:

I get an empty version table with this command. Has something changed about the package in the meantime?

```plaintext
f# apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: (none)
  Version table:

```

[Next page](https://meta.discourse.org/t/when-to-upgrade-docker-and-how/86989.md?page=2)
