-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Cannot bind port for MySQL service #2578
Comments
Hi, Don't you have mysql already running on port 3306 on your system ? If yes, this is not a bug. You just cannot have your system running a mysql instance on port 3306 and a container with a port bound to the same port number. |
Is it not possible to run act in non host network mode? |
Not for the workflow the original poster has presented. This would require an advanced DinD setup for the localhost part that is not supported. name: Unit Testing
on:
workflow_dispatch:
push:
concurrency:
group: cc-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
testing:
name: PHPUnit ${{ matrix.php }}
runs-on: ubuntu-latest
timeout-minutes: 12
strategy:
fail-fast: true
matrix:
php: [ 8.3 ]
services:
mysql_testing:
image: mysql/mysql-server:8.0
env:
MYSQL_DATABASE: database
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpassword
# Removed exposing port to host
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# This field is required for the changed workflow to work online
container: catthehacker/ubuntu:act-latest # use any container image with mysql cli / create your own
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
# Now avoid localhost and use the service name
- name: Verify MySQL connection
run: |
mysql --version
sudo apt-get install -y mysql-client
mysql --host mysql_testing --port 3306 -uuser -ppassword -e "SHOW DATABASES"
|
The following part might break act as well and download the sources from the github instead of the local version with:
fetch-depth: 1 |
Bug report info
Command used with act
Describe issue
I expected to be able to run my PHPUnit testing workflow.
Unfortunately, when I do so I am presented with an error about port binding failing due to the port already being allocated.
It fails before the first step, when trying to set up the MySQL service. If I comment that service out, the workflow proceeds but fails later due to the missing database (note: I've only included the relevant part at start of workflow file in the 'workflow content' section, but it's a self-contained working example).
This workflow works on GitHub.
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: