cloudnativedaysjp / dreamkast-ui

MIT License
7 stars 2 forks source link

Support apple silicon #198

Closed takaishi closed 2 years ago

takaishi commented 2 years ago

M1 Macで開発できるようにします。

dreamkast本体に合わせて、nodejsを16.13.1にあげました。

c.f.: https://github.com/cloudnativedaysjp/dreamkast/pull/1046

dreamkast-cloudnativedays commented 2 years ago

Review app

https://dreamkast-ui-198.dev.cloudnativedays.jp

kntks commented 2 years ago

docker-composeが動かない

おそらく以下の2つが必要だと思います

no matching manifest for linux/arm64/v8 in the manifest list entries ``` $ docker-compose up [+] Running 0/16 ⠴ db Pulling 3.4s ⠴ app Pulling 3.4s ⠋ eff15d958d66 Downloading [==============> ] 9.347MB/31.37MB 3.0s ⠋ 923e91ae3a1b Downloading [======================================> ] 7.726MB/9.988MB 3.0s ⠋ 2aa5d3a4a151 Download complete 3.0s ⠋ c1c566ce3372 Downloading [===============> ] 9.174MB/28.82MB 3.0s ⠋ d34ea7c79357 Waiting 3.0s ⠋ 9b16b365b443 Waiting 3.0s ⠋ e64ea8726a3c Waiting 3.0s ⠋ 9f991b93b340 Waiting 3.0s ⠋ cf8c0b6c4431 Waiting 3.0s ⠋ dff27457e2b5 Waiting 3.0s ⠋ 0cd723bcb639 Waiting 3.0s ⠋ a0ea742448c9 Waiting 3.0s ⠋ 570acf930dbb Waiting 3.0s ⠋ 193202338765 Waiting 3.0s no matching manifest for linux/arm64/v8 in the manifest list entries ```

ref. https://ryotarch.com/docker/no-matching-manifest-for-linux-arm64-v8-on-m1-mac/

メモ

npmを使うとdocker buildに失敗する

エラー ``` $ docker build . --tag dreamkast-ui [+] Building 13.3s (11/11) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 37B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 34B 0.0s => [internal] load metadata for docker.io/library/node:16.1 1.9s => [internal] load build context 0.0s => => transferring context: 15.72kB 0.0s => [base 1/4] FROM docker.io/library/node:16.13.1-alpine3.1 0.0s => CACHED [base 2/4] WORKDIR /base 0.0s => CACHED [base 3/4] COPY package.json yarn.lock ./ 0.0s => CACHED [base 4/4] RUN yarn install 0.0s => CACHED [stage-1 3/5] COPY --from=base /base ./ 0.0s => CACHED [stage-1 4/5] COPY . . 0.0s => ERROR [stage-1 5/5] RUN yarn build 11.3s ------ > [stage-1 5/5] RUN yarn build: #11 0.482 yarn run v1.22.15 #11 0.520 $ next build #11 1.035 info - Loaded env from /base/.env.local #11 1.210 Attention: Next.js now collects completely anonymous telemetry regarding usage. #11 1.210 This information is used to shape Next.js' roadmap and prioritize features. #11 1.210 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: #11 1.210 https://nextjs.org/telemetry #11 1.210 #11 1.328 info - Checking validity of types... #11 1.483 warn - Minimum recommended TypeScript version is v4.3.2, older versions can potentially be incompatible with Next.js. Detected: 4.2.2 #11 8.924 warn - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config #11 10.80 #11 10.80 Failed to compile. #11 10.80 #11 10.80 ./src/components/Menu/MobileMenu.tsx #11 10.80 19:29 Error: Replace `⏎········href="/cndt2021/ui/jobboard"⏎········rel="noreferrer"⏎······` with `·href="/cndt2021/ui/jobboard"·rel="noreferrer"` prettier/prettier #11 10.80 #11 10.80 ./src/components/TalkInfo/TalkInfo.tsx #11 10.80 1:16 Error: Replace `useEffect,·useState,·useCallback` with `·useEffect,·useState,·useCallback·` prettier/prettier #11 10.80 14:18 Error: Insert `,` prettier/prettier #11 10.80 27:17 Error: Replace `"Start·getViewerCount"` with `'Start·getViewerCount'` prettier/prettier #11 10.80 31:7 Error: Replace `(selectedTrackId)` with `·(selectedTrackId)·` prettier/prettier #11 10.80 32:10 Error: Insert `·` prettier/prettier #11 10.80 33:21 Error: Replace `"Trying·request"` with `'Trying·request'` prettier/prettier #11 10.80 35:37 Error: Insert `,` prettier/prettier #11 10.80 39:24 Error: Replace `"-"` with `'-'` prettier/prettier #11 10.80 54:1 Error: Delete `⏎` prettier/prettier #11 10.80 58:33 Error: Insert `(` prettier/prettier #11 10.80 60:9 Error: Insert `)` prettier/prettier #11 10.80 #11 10.80 ./src/components/TalkInfo/styled.ts #11 10.80 15:14 Error: Replace `A` with `a` prettier/prettier #11 10.80 59:14 Error: Replace `A` with `a` prettier/prettier #11 10.80 #11 10.80 ./src/components/TalkSelector/styled.ts #11 10.80 17:14 Error: Replace `A` with `a` prettier/prettier #11 10.80 #11 10.80 info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules #11 11.12 error Command failed with exit code 1. #11 11.12 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ------ executor failed running [/bin/sh -c yarn build]: exit code: 1 ```

しかし、node_modulesを削除してyarnに変更すると成功した

takaishi commented 2 years ago

9日の定例で、compose使ってる人いなさそうだし消してもいいんじゃないという話をして消す方向で進める

dreamkast-cloudnativedays commented 2 years ago

Review app

https://dreamkast-ui-198.dev.cloudnativedays.jp

takaishi commented 2 years ago

@kntks dreamkast-ui内のdocker-composeは消して、dreamkastのものを使うことにしたのでレビューでコメントしてくれた問題は解消していると思います。確認おねがいします。

takaishi commented 2 years ago

追加変更はcompose消しただけなのでマージしちゃいます