rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.82k stars 272 forks source link

Update to 1.5.0 on Mac Apple Silicon breaks existing project #2685

Open marc-fez opened 2 years ago

marc-fez commented 2 years ago

Actual Behavior

I just started with a pretty basic Django/Docker app from cookiecutter/cookiecutter-django. I had it running on my MacBook Air M1 with Rancher Desktop 1.4.1 and dockerd. I updated Rancher Desktop to 1.5.0, tried to start the app and it errored out.

I factory reset Rancher Desktop, I rebooted my laptop and still didn't work. I re-initialised the cookiecutter app in a new directory from git repo, same error I rolled Rancher Desktop back to 1.4 and the app works again.

Steps to Reproduce

Result

Docker quickly errors out and build fails

docker-compose -f local.yml build
[+] Building 2.8s (24/43)
 => [demo_app_local_django internal] load build definition from Dockerfile                                                                                          0.0s
 => => transferring dockerfile: 1.90kB                                                                                                                                      0.0s
 => [demo_app_production_postgres internal] load build definition from Dockerfile                                                                                   0.0s
 => => transferring dockerfile: 266B                                                                                                                                        0.0s
 => [demo_app_local_docs internal] load build definition from Dockerfile                                                                                            0.0s
 => => transferring dockerfile: 1.86kB                                                                                                                                      0.0s
 => [demo_app_local_django internal] load .dockerignore                                                                                                             0.0s
 => => transferring context: 167B                                                                                                                                           0.0s
 => [demo_app_production_postgres internal] load .dockerignore                                                                                                      0.0s
 => => transferring context: 167B                                                                                                                                           0.0s
 => [demo_app_local_docs internal] load .dockerignore                                                                                                               0.0s
 => => transferring context: 167B                                                                                                                                           0.0s
 => [demo_app_local_django internal] load metadata for docker.io/library/python:3.9-slim-bullseye                                                                   1.5s
 => [demo_app_production_postgres internal] load metadata for docker.io/library/postgres:14                                                                         1.3s
 => [auth] library/postgres:pull token for registry-1.docker.io                                                                                                             0.0s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                               0.0s
 => [demo_app_production_postgres internal] load build context                                                                                                      0.0s
 => => transferring context: 5.02kB                                                                                                                                         0.0s
 => [demo_app_production_postgres 1/4] FROM docker.io/library/postgres:14@sha256:9ceb24f8c5f15c053d973a3610866f473690875dc13eb3282b45302189321040                   0.0s
 => CACHED [demo_app_production_postgres 2/4] COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance                                             0.0s
 => CACHED [demo_app_production_postgres 3/4] RUN chmod +x /usr/local/bin/maintenance/*                                                                             0.0s
 => CACHED [demo_app_production_postgres 4/4] RUN mv /usr/local/bin/maintenance/* /usr/local/bin     && rmdir /usr/local/bin/maintenance                            0.0s
 => [demo_app_production_postgres] exporting to image                                                                                                               0.0s
 => => exporting layers                                                                                                                                                     0.0s
 => => writing image sha256:36dfd013a48a7ae17fde16a863514dd960e05d089558a17f620263c7d4ccb361                                                                                0.0s
 => => naming to docker.io/library/demo_app_production_postgres                                                                                                     0.0s
 => [demo_app_local_django internal] load build context                                                                                                             0.0s
 => => transferring context: 124.54kB                                                                                                                                       0.0s
 => [demo_app_local_docs internal] load build context                                                                                                               0.0s
 => => transferring context: 3.92kB                                                                                                                                         0.0s
 => CACHED [demo_app_local_docs python 1/1] FROM docker.io/library/python:3.9-slim-bullseye@sha256:fb1f5863ebed6fefa0c467353d73c4eaaaa6754e06247e606839a6f9a096a68  0.0s
 => CACHED [demo_app_local_django python-run-stage  1/11] WORKDIR /app                                                                                              0.0s
 => CANCELED [demo_app_local_django python-run-stage  2/11] RUN apt-get update && apt-get install --no-install-recommends -y   libpq-dev   gettext   && apt-get pu  1.1s
 => CANCELED [demo_app_local_docs python-build-stage 1/3] RUN apt-get update && apt-get install --no-install-recommends -y   build-essential   libpq-dev   && apt-  0.8s
 => ERROR [demo_app_local_django python-build-stage 1/3] RUN apt-get update && apt-get install --no-install-recommends -y   build-essential   libpq-dev             0.4s
 => ERROR [demo_app_local_docs python-run-stage 1/7] RUN apt-get update && apt-get install --no-install-recommends -y   make   libpq-dev   gettext   && apt-get pu  0.4s
------
 > [demo_app_local_django python-build-stage 1/3] RUN apt-get update && apt-get install --no-install-recommends -y   build-essential   libpq-dev:
#0 0.391 -c: 0: cannot open apt-get update && apt-get install --no-install-recommends -y   build-essential   libpq-dev: No such file
------
------
 > [demo_app_local_docs python-run-stage 1/7] RUN apt-get update && apt-get install --no-install-recommends -y   make   libpq-dev   gettext   && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false   && rm -rf /var/lib/apt/lists/*:
#0 0.375 -c: 0: cannot open apt-get update && apt-get install --no-install-recommends -y   make   libpq-dev   gettext   && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false   && rm -rf /var/lib/apt/lists/*: No such file
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install --no-install-recommends -y   make   libpq-dev   gettext   && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false   && rm -rf /var/lib/apt/lists/*]: exit code: 2

Expected Behavior

Docker build completes successfully

Additional Information

cookiecutter replay file ~/.cookiecutter_replay/cookiecutter-django.json

{
  "cookiecutter": {
    "project_name": "Demo App",
    "project_slug": "demo_app",
    "description": "Sanctflow demonstration application",
    "author_name": "Marc Fez",
    "domain_name": "sanctflow.com",
    "email": "marc@sanctflow.com",
    "version": "0.1.0",
    "open_source_license": "MIT",
    "timezone": "BST",
    "windows": "n",
    "use_pycharm": "n",
    "use_docker": "y",
    "postgresql_version": "14",
    "cloud_provider": "None",
    "mail_service": "Other SMTP",
    "use_async": "y",
    "use_drf": "y",
    "frontend_pipeline": "None",
    "use_celery": "n",
    "use_mailhog": "y",
    "use_sentry": "n",
    "use_whitenoise": "y",
    "use_heroku": "n",
    "ci_tool": "None",
    "keep_local_envs_in_vcs": "y",
    "debug": "n",
    "_template": "https://github.com/cookiecutter/cookiecutter-django",
    "_output_dir": "/Users/fez/workspace"
  }
}

Rancher Desktop Version

1.5.0

Rancher Desktop K8s Version

1.24.3

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

macOS 12.4

What CPU architecture are you using?

arm64 (Apple Silicon)

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

mook-as commented 2 years ago

Hi! Sorry, could you check if your images are built for x86_64 or aarch64? We have an issue (#2659) where running cross-platform binaries are broken, though it's not clear if that is the cause of this particular issue. (docker image inspect … should contain an Architecture field.)

marc-fez commented 2 years ago

@mook-as Here you go, this is on RD 1.4.1 (working)

        "Architecture": "amd64",
        "Os": "linux",
mook-as commented 2 years ago

Thank you! In that case, this sounds related to the mentioned issue, and should be better in RD 1.5.1. (which we're aiming to release within a week or two, barring more fatal issues). Or, at a minimum, if the issue isn't resolved with it, it'll be easier to troubleshoot.

Sorry for the trouble!