-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Resolve docker-dev build failures for arm64 and macOS #641
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
northdpole
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Just a couple comments and this is ready
|
|
||
| dev-flask: | ||
| . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run | ||
| . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run --host=0.0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host cannot be 0.0.0.0 this exposes your Dev server to the network. There's a reason it's localhost by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added --host=0.0.0.0 because when Flask runs inside Docker, binding only to 127.0.0.1 makes the server reachable exclusively from inside the container. Even with -p 5001:5000, the host can’t access the app (resulting in ERR_CONNECTION_RESET), since Flask is not listening on the container’s external interface. Using 0.0.0.0 resolves that and makes the dev container usable on macOS and Linux.
Thanks for pointing this out — I’ll revisit this and look for an approach that keeps the default local behavior secure while still allowing the Docker-based setup to function correctly. I’ll update the PR with a cleaner solution.
|
|
||
| docker-dev-run: | ||
| docker run -it -p 5000:5000 opencre-dev:$(shell git rev-parse HEAD) | ||
| docker run -it -p 5001:5000 opencre-dev:$(shell git rev-parse HEAD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On macOS, port 5000 is often reserved by the system AirPlay Receiver service (ControlCe), so docker run -p 5000:5000 fails with: Error: address already in use
This prevents make docker-dev-run from working out-of-the-box for macOS contributors.
Mapping the container’s 5000 to a different host port (5001) avoids the OS-level port conflict while keeping the container port unchanged.
This change fixes the macOS dev experience without affecting Linux/WSL users.
Fixes #640
This PR addresses multiple issues that were causing the
make docker-devcommand to fail for users onarm64(Apple Silicon) machines.1. Fixes Puppeteer/Chromium Build Failure
yarn installbecausepuppeteercould not find a pre-builtarm64Linux binary for Chromium.RUN apt-get update && apt-get install -y chromiumstep to theDockerfile-devto install the required binary beforeyarn installis run.2. Fixes Missing Python 'venv' Error
make install-deps-pythoncommand checks for a./venvdirectory that hadn't been created.python3 -m venv venvto the Dockerfile to create the virtual environment before themakecommand is called.3. Resolves macOS Port Conflict
make docker-dev-runfailed with an "address already in use" error, as port 5000 is often used by the macOS AirPlay Receiver.docker-dev-runtarget in theMakefileto map to port5001on the host (-p 5001:5000) to avoid this common conflict.With these changes, users on
arm64/macOS can successfully build and run the development container.