-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Local Environment Docker alternate port issue #4626
Comments
Well, that's annoying. I didn't realise The methods for working around this behaviour are all pretty hacky. The least awful option seems to be to use Variable Substitution in |
What about this with some docs to the effect of "If you need to override some thing, copy the entire diff --git bin/install-docker.sh bin/install-docker.sh
index a6617407..f4e0edd2 100755
--- bin/install-docker.sh
+++ bin/install-docker.sh
@@ -28,7 +28,12 @@ docker-compose pull --parallel
# Launch the containers
echo -e $(status_message "Starting Docker containers...")
-docker-compose up -d >/dev/null
+
+if [ -f ../docker-compose.override.yml ]; then
+ docker-compose -f docker-compose.override.yml up -d >/dev/null
+else
+ docker-compose up -d >/dev/null
+fi
HOST_PORT=$(docker-compose port wordpress 80 | awk -F : '{printf $2}') |
That will probably end up with people having out-of-sync |
Cool, I'll take a look at a patch using said "Variable Substitution" a bit later... |
Isn't something @notnownikki solved in #8818? https://github.com/WordPress/gutenberg/blob/master/bin/bootstrap-env.sh#L8-L12 |
Yes, that will work fine, closing this 👍 |
Issue Overview
Unable to use an alternate port override in
docker-compose.override.yml
These are the 4 configuration options I've tried thus far in my local
docker-compose.override.yml
file:Steps to Reproduce (for bugs)
docker-compose.override.yml
file with one of the above configurations./bin/setup-local-env.sh
Note: I have an existing source bound to port
8888
which is why I'm trying to use an alternate port.Expected Behavior
I expected the Docker images to be successfully created and started
Current Behavior
The
gutenberg_wordpress_1
container returns the errorError starting userland proxy: Bind for 0.0.0.0:8888 failed: port is already allocated
Possible Solution
A workaround is to copy the base
docker-compose.yml
file todocker-compose.override.yml
viacp docker-compose.yml docker-compose.override.yml
and change the port from8888
to8484
and then changedocker-compose up -d
todocker-compose -f docker-compose.override.yml up -d
inbin/install-docker.sh
(src) and everything works as expected:WordPress is now available at http://localhost:8484/ and works 👌
Screenshots / Video
Related Issues and/or PRs
Todos
@pento any thoughts as to why none of my overrides posted above didn't work?
The text was updated successfully, but these errors were encountered: