I'm setting up a dev environment on 2 macs, the first one of which is running Gitea in a Docker container (see docker-compose below). I've setup an /etc/hosts
entry on each mac for the hostname gitea
and I have opened port 3333 on the first Mac using pfctl
:
rdr pass log (all) on lo0 inet proto tcp from any to any port 3333 -> 127.0.0.1 port 3333
For simplicity I'm using HTTP for now and I can successfully browse to http://gitea:3333 from both machines. This proves that mac 2 can access gitea on mac 1 (via docker) over http.
I've made a git remote on each mac: http://gitea:3333/MyOrg/MyProject.git
and I can git pull and push to the repo from the first mac but when I try to pull code via the second mac, I get the following error:
fatal: http://gitea:3333/MyOrg/MyProject.git/info/refs not valid: is this a git repository?
The git remote is connected using an account with write access from both machines.
The docker-compose.yml
is as follows. I've tried docker compose version 2 and 3. I've created a static IP for the gitea container using a docker network. I've tried various combinations of adding hostname
and extra_hosts
but can't get the second mac to pull from the repo.
version: '2'
services:
mariadb:
image: mariadb
restart: always
environment:
- ...
volumes:
- ./mariadb/data:/var/lib/mysql
command:
'mysqld --innodb-flush-method=fsync'
networks:
giteanet:
ipv4_address: 172.0.0.11
gitea:
image: gitea/gitea
volumes:
- ./gitea/data:/data
ports:
- '3333:3000'
- '2222:22'
depends_on:
- mariadb
environment:
- DB_TYPE=mysql
- DB_HOST=mariadb:3306
...
- APP_NAME='Gitea'
- HOST=gitea
restart: always
networks:
giteanet:
ipv4_address: 172.0.0.10
hostname: gitea
networks:
giteanet:
driver: bridge
ipam:
config:
- subnet: 172.0.0.0/24