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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix update script for mac silicon #2073

Merged
merged 2 commits into from May 15, 2024

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Apr 25, 2024

Fixes #1848, but I'm not sure if it's the correct fix.

If I set arch as arm64, I get this diff:

diff --git i/18/alpine3.18/Dockerfile w/18/alpine3.18/Dockerfile
index fb8836d..065cb4a 100644
--- i/18/alpine3.18/Dockerfile
+++ w/18/alpine3.18/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.18
+FROM arm64/alpine:3.18
 
 ENV NODE_VERSION 18.20.2
 
diff --git i/18/alpine3.19/Dockerfile w/18/alpine3.19/Dockerfile
index 22a2c85..4652a8f 100644
--- i/18/alpine3.19/Dockerfile
+++ w/18/alpine3.19/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.19
+FROM arm64/alpine:3.19
 
 ENV NODE_VERSION 18.20.2
 
diff --git i/18/bookworm-slim/Dockerfile w/18/bookworm-slim/Dockerfile
index 83f954b..be12682 100644
--- i/18/bookworm-slim/Dockerfile
+++ w/18/bookworm-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bookworm-slim
+FROM arm64/debian:bookworm-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/18/bookworm/Dockerfile w/18/bookworm/Dockerfile
index cd31775..9108880 100644
--- i/18/bookworm/Dockerfile
+++ w/18/bookworm/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bookworm
+FROM arm64/buildpack-deps:bookworm
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/18/bullseye-slim/Dockerfile w/18/bullseye-slim/Dockerfile
index aa58ba9..ca21112 100644
--- i/18/bullseye-slim/Dockerfile
+++ w/18/bullseye-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM arm64/debian:bullseye-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/18/bullseye/Dockerfile w/18/bullseye/Dockerfile
index a6e6dfc..8fa4e6e 100644
--- i/18/bullseye/Dockerfile
+++ w/18/bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bullseye
+FROM arm64/buildpack-deps:bullseye
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/18/buster-slim/Dockerfile w/18/buster-slim/Dockerfile
index 48b0f11..711f523 100644
--- i/18/buster-slim/Dockerfile
+++ w/18/buster-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:buster-slim
+FROM arm64/debian:buster-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/18/buster/Dockerfile w/18/buster/Dockerfile
index 51590c3..7bb1d5b 100644
--- i/18/buster/Dockerfile
+++ w/18/buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:buster
+FROM arm64/buildpack-deps:buster
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/alpine3.18/Dockerfile w/20/alpine3.18/Dockerfile
index faa5209..99d9034 100644
--- i/20/alpine3.18/Dockerfile
+++ w/20/alpine3.18/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.18
+FROM arm64/alpine:3.18
 
 ENV NODE_VERSION 20.12.2
 
diff --git i/20/alpine3.19/Dockerfile w/20/alpine3.19/Dockerfile
index c915d57..ef08e64 100644
--- i/20/alpine3.19/Dockerfile
+++ w/20/alpine3.19/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.19
+FROM arm64/alpine:3.19
 
 ENV NODE_VERSION 20.12.2
 
diff --git i/20/bookworm-slim/Dockerfile w/20/bookworm-slim/Dockerfile
index 9b357c6..66e4563 100644
--- i/20/bookworm-slim/Dockerfile
+++ w/20/bookworm-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bookworm-slim
+FROM arm64/debian:bookworm-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/bookworm/Dockerfile w/20/bookworm/Dockerfile
index 21e6f06..4fa1e06 100644
--- i/20/bookworm/Dockerfile
+++ w/20/bookworm/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bookworm
+FROM arm64/buildpack-deps:bookworm
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/bullseye-slim/Dockerfile w/20/bullseye-slim/Dockerfile
index 3cd6cef..cf5c35a 100644
--- i/20/bullseye-slim/Dockerfile
+++ w/20/bullseye-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM arm64/debian:bullseye-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/bullseye/Dockerfile w/20/bullseye/Dockerfile
index 6aae693..891cee1 100644
--- i/20/bullseye/Dockerfile
+++ w/20/bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bullseye
+FROM arm64/buildpack-deps:bullseye
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/buster-slim/Dockerfile w/20/buster-slim/Dockerfile
index dcb2bc2..5b9a0fe 100644
--- i/20/buster-slim/Dockerfile
+++ w/20/buster-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:buster-slim
+FROM arm64/debian:buster-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/20/buster/Dockerfile w/20/buster/Dockerfile
index b1fae95..7f08c96 100644
--- i/20/buster/Dockerfile
+++ w/20/buster/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:buster
+FROM arm64/buildpack-deps:buster
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/21/alpine3.18/Dockerfile w/21/alpine3.18/Dockerfile
index 4150fb1..4235a64 100644
--- i/21/alpine3.18/Dockerfile
+++ w/21/alpine3.18/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.18
+FROM arm64/alpine:3.18
 
 ENV NODE_VERSION 21.7.3
 
diff --git i/21/alpine3.19/Dockerfile w/21/alpine3.19/Dockerfile
index 87cdabe..ecc2166 100644
--- i/21/alpine3.19/Dockerfile
+++ w/21/alpine3.19/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.19
+FROM arm64/alpine:3.19
 
 ENV NODE_VERSION 21.7.3
 
diff --git i/21/bookworm-slim/Dockerfile w/21/bookworm-slim/Dockerfile
index 6e502c6..a0687d4 100644
--- i/21/bookworm-slim/Dockerfile
+++ w/21/bookworm-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bookworm-slim
+FROM arm64/debian:bookworm-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/21/bookworm/Dockerfile w/21/bookworm/Dockerfile
index 51a91cd..195e551 100644
--- i/21/bookworm/Dockerfile
+++ w/21/bookworm/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bookworm
+FROM arm64/buildpack-deps:bookworm
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/21/bullseye-slim/Dockerfile w/21/bullseye-slim/Dockerfile
index fac738b..44ad73d 100644
--- i/21/bullseye-slim/Dockerfile
+++ w/21/bullseye-slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM arm64/debian:bullseye-slim
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
diff --git i/21/bullseye/Dockerfile w/21/bullseye/Dockerfile
index e0842c0..e0a7ec7 100644
--- i/21/bullseye/Dockerfile
+++ w/21/bullseye/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:bullseye
+FROM arm64/buildpack-deps:bullseye
 
 RUN groupadd --gid 1000 node \
   && useradd --uid 1000 --gid node --shell /bin/bash --create-home node

which seems wrong 馃榾

@SimenB SimenB requested a review from a team April 25, 2024 14:28
functions.sh Outdated
@@ -32,6 +32,9 @@ function get_arch() {
s390x)
arch="s390x"
;;
arm64)
arch="amd64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the mismatch arch here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also confused here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dunno, but it produces the correct diff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaah, this should be arm64 just like the one below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see OP - that gives the wrong diff

@LaurentGoderre
Copy link
Member

I don't think this is right. It should explicitly define the arch

@SimenB
Copy link
Member Author

SimenB commented May 14, 2024

Feel free to push to this branch 馃榾

@LaurentGoderre
Copy link
Member

What is broken that this fixes?

@SimenB
Copy link
Member Author

SimenB commented May 14, 2024

Running the update script on arm64 macs (see linked #1848)

@LaurentGoderre
Copy link
Member

Ooooh, the diff you posted is what you get before the fix.

@SimenB
Copy link
Member Author

SimenB commented May 14, 2024

No, the diff is if I do arch="arm64". Without the changes in this PR the script exits with 1 long before updating any files at all.

@LaurentGoderre LaurentGoderre force-pushed the fix-update-script-for-apple-silicon branch from 92ec633 to 8739d1e Compare May 14, 2024 14:28
@LaurentGoderre
Copy link
Member

@SimenB @PeterDaveHello fixed.

Copy link
Member Author

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script works correctly for me now, thanks @LaurentGoderre!

Not sure if the fix is correct for linux arm64, but we can cross that bridge if we ever get to it 馃榾 Ideally your own arch shouldn't impact the update scripts anyways, but w/e

Somebody else needs to approve as I'm not allowed as the author 馃槄

@PeterDaveHello PeterDaveHello self-requested a review May 15, 2024 20:28
Copy link
Member

@PeterDaveHello PeterDaveHello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it a try.

@PeterDaveHello PeterDaveHello merged commit 138fbab into main May 15, 2024
3 checks passed
@PeterDaveHello PeterDaveHello deleted the fix-update-script-for-apple-silicon branch May 15, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update script doesn't work on arm64 macs
3 participants