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

Cannot run apt-get from dockerfile after Ubuntu 19.04 EOL #1398

Closed
lechien73 opened this issue Apr 15, 2020 · 10 comments
Closed

Cannot run apt-get from dockerfile after Ubuntu 19.04 EOL #1398

lechien73 opened this issue Apr 15, 2020 · 10 comments
Labels

Comments

@lechien73
Copy link

Describe the bug

Our custom dockerfile installs tools and runs apt-get update -y. Since the update to Ubuntu 19.04, this now causes an error. The text is below and a screenshot is attached:

Reading package lists...
E: The repository 'http://archive.ubuntu.com/ubuntu disco Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-backports Release' does not have a Release file.
E: The repository 'http://security.ubuntu.com/ubuntu disco-security Release' does not have a Release file.
build failed: cannot build base image: The command '/bin/sh -c apt-get update -y' returned a non-zero code: 100
Error: build failed: cannot build base image: The command '/bin/sh -c apt-get update -y' returned a non-zero code: 100

Steps to reproduce

Create a new repository using this template: https://github.com/Code-Institute-Org/gitpod-full-template
Attempt to open the resulting repo in Gitpod.

Expected behavior

A new workspace is created containing the tools we were able to install using Ubuntu 18.04

Screenshot 2020-04-15 at 11 36 02

@jankeromnes
Copy link
Contributor

Hi @lechien73!

Sorry for the disruption. As mentioned via email, we actually upgraded to 19.04 almost a year ago: gitpod-io/workspace-images#94

However, what probably caused the recent breakage is that 19.04 reached end-of-life on 23 January 2020: https://wiki.ubuntu.com/Releases so I think many Apt repositories are now pulling their packages for Disco (I know at least ppa:ondrej/php did).

In hindsight, it was a mistake to upgrade to a non-LTS version of Ubuntu. We're now in the process of upgrading to Ubuntu 20.04 LTS: gitpod-io/workspace-images#196 However, it's officially released toward the end of this month, so there may still be a few rough edges to smooth out.

@jankeromnes
Copy link
Contributor

See also gitpod-io/workspace-images#203 where I'm planning to run a few experiments and see if we can quickly fix your build.

@lechien73 lechien73 changed the title Cannot run apt-get from dockerfile after update to Ubuntu 19.04 Cannot run apt-get from dockerfile after Ubuntu 19.04 EOL Apr 15, 2020
@jankeromnes
Copy link
Contributor

jankeromnes commented Apr 15, 2020

@lechien73 Oh, one more thing: I notice in your Dockerfile that you're running apt-get update and apt-get install in different RUN instructions:

https://github.com/Code-Institute-Org/gitpod-full-template/blob/master/.gitpod.dockerfile#L7-L14

That's problematic, and could be the root cause of the apt-get problems you're seeing.

When you do:

RUN sudo apt-get update
RUN sudo apt-get install -y something

Both instructions can be cached at different points in time, which means that the result from apt-get update may get severely out-dated when you try the apt-get install again later.

Instead, it's important to do:

RUN sudo apt-get update && \
    sudo apt-get install -y something

whenever you want to apt-get install something (it's fine to repeat it multiple times in a Dockerfile, but a apt-get install RUN instruction should always also include a apt-get update first).

And while we're here, if you add sudo rm -rf /var/lib/apt/lists/* at the end, you save a ton of space in the final image, leading to faster workspace starts.

To summarize, you'll want something like this:

Dockerfile
RUN sudo apt-get update && \
    sudo apt-get install -y something && \
    sudo rm -rf /var/lib/apt/lists/*

@lechien73
Copy link
Author

Thanks Jan, unfortunately the same problem happens even with a standard apt-get update -y and nothing else. I guess it is due to 19.04's EOL status, as you said.

@lechien73
Copy link
Author

Yes, the actual issue is that Disco has been removed from the Ubuntu repos: http://archive.ubuntu.com/ubuntu/dists/

@jankeromnes
Copy link
Contributor

jankeromnes commented Apr 15, 2020

Indeed. 🤦 I confirm that all Gitpod image builds are now broken:

Screenshot 2020-04-15 at 14 01 44

The errors are the same as yours:

E: The repository 'http://security.ubuntu.com/ubuntu disco-security Release' no longer has a Release file.
E: The repository 'https://repo.mongodb.org/apt/ubuntu disco/mongodb-org/4.0 Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco Release' no longer has a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-updates Release' no longer has a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-backports Release' no longer has a Release file.

This means that workspaces with a custom .gitpod.Dockerfile that's using apt-get are now broken.

However, workspaces that don't have a custom Dockerfile, or that have a custom Dockerfile which doesn't use apt-get, will still work.

We'll try to fix this as soon as possible.

@Kreyren
Copy link

Kreyren commented Apr 15, 2020

@Kreyren would just use debian stable assuming ubuntu being maintained by incompetent developers and is being pita to manage in production system

@jankeromnes
Copy link
Contributor

jankeromnes commented Apr 15, 2020

Update: We've merged the Ubuntu Focal 20.04 upgrade. A new gitpod/workspace-full is being built, and should be pushed to Docker Hub in < 60 minutes.

Other images like gitpod/workspace-mysql and gitpod/workspace-mongodb will follow shortly after.

EDIT: If you don't want to wait, these images are already available:

  • gitpod/workspace-full:branch-jx-ubuntu-focal
  • gitpod/workspace-mongodb:branch-jx-ubuntu-focal
  • gitpod/workspace-mysql:branch-jx-ubuntu-focal
  • gitpod/workspace-postgres:branch-jx-ubuntu-focal
  • gitpod/workspace-full-vnc:branch-jx-ubuntu-focal
  • gitpod/workspace-flutter:branch-jx-ubuntu-focal

@jankeromnes
Copy link
Contributor

jankeromnes commented Apr 15, 2020

Re-update: These images are now based on Ubuntu 20.04:

  • gitpod/workspace-full (i.e. gitpod/workspace-full:latest)
  • gitpod/workspace-postgres (i.e. gitpod/workspace-postgres:latest)
  • gitpod/workspace-flutter (i.e. gitpod/workspace-flutter:latest)
  • gitpod/workspace-mysql (i.e. gitpod/workspace-mysql:latest)
  • gitpod/workspace-mongodb (i.e. gitpod/workspace-mongodb:latest)
  • gitpod/workspace-full-vnc (i.e. gitpod/workspace-full-vnc:latest)

@jankeromnes
Copy link
Contributor

Ok, all major Gitpod images online are now based on Ubuntu 20.04, which fixes this issue. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants