LambdaLabs / docsy-lambda-docs

3 stars 8 forks source link

Document how to preview changes locally on M1 (and M2?) Macs #237

Closed cbrownstein-lambda closed 9 months ago

cbrownstein-lambda commented 1 year ago

Following the existing instructions for previewing changes locally produces ld-linux-x86-64.so.2: /usr/lib/hugo/hugo: Not a valid dynamic program.

Using the following docker-compose.yaml and Dockerfile doesn't solve the problem:

version: "3.3"
​
services:
​
  site:
    image: lambdalabs/lambda-docs
    platform: linux/amd64
    build:
      context: .
    command: server
    ports:
      - "1313:1313"
    volumes:
      - .:/src
FROM --platform=linux/amd64 klakegg/hugo:ext-alpine
​
RUN apk add git && \
  git config --global --add safe.directory /src

cc: @brasmi

cbrownstein-lambda commented 1 year ago

Use Rosetta for x86/amd64 emulation on Apple Silicon needs to be enabled in Docker Desktop.

Credit: @bryangwin for the solution.

cbrownstein-lambda commented 9 months ago

The docs are being migrated to GitBook ⇒ closing.