Skip to content

Conversation

@seslash
Copy link

@seslash seslash commented Jan 9, 2026

Current docker file hardcodes compile platform to be AMD64. This leads to failed builds on ARM-based Macs. This PR switched target platform from static value to dynamic system var.

This addresses the following warning message when running:

 1 warning found (use docker --debug to expand):
 - FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" (line 1)

Current docker file hardcodes compile platform to be AMD64. This leads to failed builds on ARM-based Macs.
This PR switched target platform from static value to dynamic system var.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make the Dockerfile platform-agnostic by replacing the hardcoded linux/amd64 platform with a dynamic system variable. The change addresses build warnings and compatibility issues on ARM-based Macs.

Changes:

  • Updated FROM statement to use $BUILDPLATFORM instead of hardcoded linux/amd64

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Dockerfile Outdated
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 python:3.12-slim
FROM --platform=$BUILDPLATFORM python:3.12-slim
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Using BUILDPLATFORM here will build the image for the host platform (where the build is running), but this may not be the desired behavior. BUILDPLATFORM is typically used for build tools in multi-stage builds. For the final runtime image, you should use TARGETPLATFORM instead, which represents the platform you're building for. Alternatively, removing the --platform flag entirely will allow Docker to automatically use the appropriate platform.

Suggested change
FROM --platform=$BUILDPLATFORM python:3.12-slim
FROM --platform=$TARGETPLATFORM python:3.12-slim

Copilot uses AI. Check for mistakes.
@seslash seslash force-pushed the sergey_dev branch 2 times, most recently from 322a6dc to c74c047 Compare January 21, 2026 22:54
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.

1 participant