Skip to content

Commit

Permalink
Fix invalid template with docker 3.5.1 #486
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust committed Jul 20, 2021
1 parent 3f8b3cb commit a5ec797
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ Otherwise, this project now automatically sets up Xdebug support with VS Code. I

Running Docker on Linux should be pretty straight-forward. Note that you need to run some [post install commands](https://docs.docker.com/install/linux/linux-postinstall/) as well as [installing Docker Compose](https://docs.docker.com/compose/install/). These steps are taken care of automatically with Docker Desktop, but not on Linux.

Be sure to see the "Linux only" documentation in the [docker-compose.dev.yml](https://github.com/markshust/docker-magento/blob/master/compose/docker-compose.dev.yml#L30) file. The `extra_hosts` param is required to be defined on Linux for proper DNS resolution.
The `host.docker.internal` hostname is [hard-coded in the php.ini file](https://github.com/markshust/docker-magento/blob/master/images/php/7.4/conf/php.ini#L8), but this hostname does not exist on Linux. To make this hostname resolve, uncomment the `extra_hosts` param in the `docker-compose.dev.yml` file, and replace `IP` with result of:

```
docker run --rm alpine ip route | awk 'NR==1 {print $3}'
```

You may also have to increase a virtual memory map count on the host system. It is required by [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html).

Expand All @@ -395,7 +399,7 @@ Add following line to `/etc/sysctl.conf`:
vm.max_map_count=262144
```

To enable Xdebug on linux, you'll also need to open port 9001 on the firewall with:
To enable Xdebug on Linux, you'll also need to open port 9001 on the firewall by running:

```
sudo iptables -A INPUT -p tcp --dport 9001 -j ACCEPT
Expand Down
3 changes: 1 addition & 2 deletions compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ services:

phpfpm:
volumes: *appvolumes
# Linux only: host.docker.internal doesn't exist https://github.com/docker/for-linux/issues/264
# Uncomment two lines below & replace IP with result of: docker run --rm alpine ip route | awk 'NR==1 {print $3}'
# Linux users, see https://github.com/markshust/docker-magento#linux for updates needed below
#extra_hosts:
# - "host.docker.internal:IP"

Expand Down

0 comments on commit a5ec797

Please sign in to comment.