Skip to content

Dockerfile: multi-stage build for extension image #9

@HerbHall

Description

@HerbHall

Description

Rewrite the stub Dockerfile into a proper multi-stage build: Go backend + React frontend + Alpine final image.

Deliverables

  • Stage 1: golang:1.22-alpine — cross-compile Go backend with TARGETOS/TARGETARCH
  • Stage 2: node:22-alpine — build React frontend with npm run build
  • Stage 3: alpine:3.19 — copy binary + built UI + metadata + icon
  • Update Makefile if needed for new build flow

Technical Notes

  • CGO_ENABLED=0 for static binary
  • --platform=$BUILDPLATFORM for cross-compilation
  • CMD starts /packetdeck-backend
  • UI files go to /ui directory (matching metadata.json ui.dashboard-tab.root)
  • Keep extension labels (KG#83)
  • .hadolint.yaml for DL3048/DL3045 ignores (KG#78)

Acceptance Criteria

  • docker build -t packetdeck:test . succeeds
  • docker buildx build --platform=linux/amd64,linux/arm64 . succeeds
  • docker extension validate packetdeck:test passes
  • docker extension install packetdeck:test installs and opens

Wave

Wave 3 (sequential). Depends on #2, #4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraBuild, CI, Docker infrastructuremvpMinimum viable product - Phase 1

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions