From 4da575c6e908e715a112cc0ce0fbb90f5f49ae30 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 28 Nov 2023 00:07:42 +0000 Subject: [PATCH 1/2] Build amd64 for some containers on Apple Silicon --- docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 62d0c1a20..cc667bf71 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,12 @@ services: web: build: . + # Sorbet doesn't currently build for Linux ARM64 (see https://github.com/sorbet/sorbet/issues/4119) + # So, we're forced to build the container as linux/amd64 always and lean on Rosetta + # on Apple silicon for running this. + # Important: if you're on Apple Silicon ensure that "Use Rosetta for x86/amd64 emulation on Apple Silicon" + # is switched on in Docker Desktop. + platform: linux/amd64 volumes: - .:/app - gem_cache:/usr/local/bundle/gems @@ -16,6 +22,8 @@ services: postfix: build: . + # Same as "web" service above because of sorbet we need to build as amd64 + platform: linux/amd64 volumes: - .:/app - gem_cache:/usr/local/bundle/gems @@ -29,6 +37,9 @@ services: postgres: # Same version as used in production image: postgis/postgis:15-3.3 + # There isn't yet a linux/arm64 build of postgis on docker + # See https://github.com/postgis/docker-postgis/issues/216 + platform: linux/amd64 ports: # Give access to the database from your host machine. This is useful # if you want to poke around. From 6f5fa314d7a76253f48eeeefb2cbfd61eac4e078 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 28 Nov 2023 03:16:15 +0000 Subject: [PATCH 2/2] Install fish shell in a different way This way works with the container being built for a different platform than it's running on --- .devcontainer/devcontainer.json | 6 +++--- Dockerfile | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bfbcfdf64..df2294cbf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,11 +17,11 @@ // The optional 'workspaceFolder' property is the path VS Code should open by default when // connected. This is typically a file mount in .devcontainer/docker-compose.yml "workspaceFolder": "/app", - "features": { - "ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {} - }, "customizations": { "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "fish" + }, "extensions": [ "wingrunr21.vscode-ruby", "karunamurti.haml", diff --git a/Dockerfile b/Dockerfile index 0b3cf7309..47870df2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,6 +43,9 @@ RUN apt-get install -y nodejs # Install firefox for running some integration tests RUN apt-get update; apt-get install -y firefox-esr +# Install the fish shell +RUN apt-get install -y fish + USER deploy COPY --chown=deploy:deploy Gemfile /app/Gemfile