One reason I've come across is that in some versions of docker (pre 1.2), there's a bug where if it detects a port is already assigned (perhaps even to a system, not docker run, program like nginx) it will continue to fail to reassign it even if you stop the conflicting thing, until you restart docker. Getting Started with LinuxKit on MacOS. GitHub Gist: instantly share code, notes, and snippets. Install a Docker Engine and Docker Compose. Install Docker for Mac, which includes the Docker engine and a recent version of docker-compose out of the box. Once you have Docker for Mac installed, open up the preferences pane for Docker, go to the 'Resources' section and increase the allocated memory to 6GB. Docker ps lists only the running containers. Use docker ps -a to see the list of all the container, it will list the containers that are stopped as well. May be a stopped container is using the port. Docker rm or docker rm to remove the container. Port will be released only when the container is removed.

Overview¶

This page describes using ISLE-DC to launch Islandora as a suite of Docker Containers (ISLE). This is an alternative to the Islandora Ansible Playbook, which creates the Islandora stack on a single virtual machine. At the end of this tutorial, you will have a local development environment, and be able to use Docker to launch, shut down, and edit your environment.

What is ISLE?¶

ISLE, or ISLandora Enterprise, is a community initiative to ease the installation and maintenance of Islandora by using Docker. It was an initiative of the Islandora Collaboration Group, first using Islandora 7.x, and later with Islandora 8.x. The code for the Islandora Enterprise 8 Prototype (ISLE 8, sometimes just ISLE) is now under the purview of the Islandora Foundation. ISLE may also refer to the ISLE system for Islandora 7.

Why use Docker?¶

Docker is a way to separate out the 'state' of your site (i.e. all the content, files, and configurations that you've entered) from the underlying software that runs it (e.g. webserver, database engine, etc). This allows for easier upgrades, faster development, and more flexible deployment.

Where is ISLE 8?¶

ISLE 8 is a suite of Docker containers that run the various components of Islandora required by Islandora Defaults: drupal, fedora, solr, alpaca, crayfish, matomo, etc. The individual containers are created (and automatically pushed to Docker Hub) by ISLE BuildKit.

How do I install ISLE?¶

Install ISLE locally or remotely using the Docker Compose scripts (ISLE-DC) at (Islandora-Devops/isle-dc). These are instructions to pull down and configure the necessary containers from Docker Hub. Unlike the Islandora Playbook, this method does not require Ansible, or (for local installations) VirtualBox. Like the Playbook, it has been optimized for development environments but in theory could be used in production.

These instructions describe using ISLE-DC locally to create a development Islandora sandbox. More detailed configuration options are described in the project's README.

Requirements¶

  • A computer that can run Docker (version 19.x+) and has at least 8GB of RAM (ideally 16GB)
  • An administrator account
  • (Mac OS) Apple Developer Tools
  • (Windows) The following setup has been tested:
    • Windows 10
    • Ubuntu 20.04 running on WSL 2
    • GNU make, run sudo apt update and sudo apt install make to install
    • Docker Desktop for Windows, using the WSL 2 based engine (Settings > General) and with the WSL integration active for Ubuntu (Settings > Resources > WSL integration)
  • If using make dev, see the README for other requirements.

What are we missing?

Are you, or your computer, new to spinning up development sandboxes? Do you have wisdom about installing make on Windows? We suspect these requirements may be incomplete and your experience would be appreciated at Issue #1640.

Installing Docker¶

To see if you have Docker installed, type docker --version in a terminal.

If you need to install Docker, we recommend using the application Docker Desktop. It provides a GUI for managing Docker container in Windows and MacOS, along with the Docker engine and suite of command-line tools. Linux users don't get a desktop client, but can download the Engine and command-line tools from that same link.

There is also a legacy project called Docker Toolbox which may be of interest if your machine cannot run Docker Desktop, or if you already have it installed.

Memory, Processors, and Swap Requirements

To run ISLE on Docker Desktop, you must increase the resources allocated to the software. See Docker docs on setting resources on Windows (see note on how to allocate/restrict memory when using WSL 2) or setting resources on Mac.

CPUs (processors): The CPUs allowed to Docker Desktop are still shared with the host machine, so increasing this to the maximum value should allow both the Docker containers and your host machine to run simultaneously.

Memory (RAM): This memory is completely dedicated to Docker while Docker Desktop is running, so do not allocate more than you can spare and still run your host machine. Windows users may not require as much memory for Docker as Mac users. Current suggestions for memory allocated to Docker Desktop are below, but please edit this document if you have new information.

  • Sandbox (make): 4GB
  • Development (make dev): 8GB
  • Production or production-like development: 16GB

Swap: Swap space is space borrowed from your hard disk drive to serve as makeshift RAM as needed. If you cannot provide as much RAM as you would like, increase this as is reasonable given your free disk space.

Launching Islandora with Docker¶

Summary: Using git, clone the isle-dc project. In that directory, enter the command make (or make dev - see note) to build the docker infrastructure. Then use the command docker-compose up -d to start the containers.

ISLE-DC variants: make vs make dev

The make command alone will spin up a sandbox-like version of ISLE, but only with a front end. The code files will be inaccessible, and you will not be able to install additional modules or themes. The make dev command creates a full-fleged development environment. It will copy the active Drupal codebase locally in a way that is also live to the ISLE site. This method takes longer (and may require multiple retries if your internet connection is spotty) but is required if you will be testing pull requests or writing code.

Results of make:

Troubleshooting - Docker Versions

If you get an error such as: ERROR: Version in './docker-compose.activemq.yml' is unsupported., then you need to upgrade Docker. Enter the command make clean before re-attempting to make.

Troubleshooting - re-attempting make

Failed port is already allocated issue 1114 docker for mac github version

If make fails for any reason, enter make clean before attempting to make again. If not, you may see an error such as: ERROR: Top level object in './docker-compose.yml' needs to be an object not '<class 'NoneType'>'.

Issue

Troubleshooting - docker containers exit without warning

If you notice some Docker containers drop (exited(0)), and (in Docker Desktop) the isle-dc app icon is yellow instead of green, try increasing the resources allocated to Docker (see note above).

Development version - access the codebase

If you used make dev, then you will have a new directory in the current (isle-dc) directory named codebase, containing the live Drupal root folder (containing your Drupal's composer files and the web/ subdirectory).

Once make has successfully completed, launch the ISLE containers using docker-compose up. The -d flag allows you to return to using the command line. Without it, your shell will be stuck in the docker-compose process as long as the containers are running.

Troubleshooting - connection timed out (Mac).

If you are using Docker Desktop for Mac, and get timeout errors when spinning up the containers (during docker-compose up -d or during make dev) such as this:

ERROR: for isle-dc_mariadb_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=480)

you can try quitting Docker completely (make sure there is no whale icon in your top toolbar - may need to select 'Quit' from the whale icon itself) and then restart Docker.

Visiting your Islandora site¶

Direct a browser to https://islandora.traefik.me/. If your containers are still 'spinning up', you will see a white screen with the words 'Bad Gateway'. This often lasts 2-5 minutes, and should be shorter for subsequent launches. If it takes more than a few minutes, check to make sure that none of your containers have failed to launch (see note above on 'Troubleshooting - docker containers exit without warning'). When all containers are ready, you should see a basic Drupal login screen.

To log in:

  • username: admin
  • password: password

Note

docker logs -tf isle-dc_drupal_1 shows Docker logs for the 'drupal' container, which will continue to have new log entries as long as the drupal box is still starting up. When it gets to confd using 'env' backend, you're done. docker-compose logs is like a firehose, showing the log messages from all containers.

Spinning down your Islandora site¶

To shut down the containers without destroying your site, use docker-compose down. To also destroy your 'state' (i.e. your content, your database, your files), use docker-compose down -v.

Editing Code in Docker¶

If you used make dev then the drupal root folder is in a new directory in the isle-dc folder named codebase. This is live and editable in whatever development environment you would like. If you just did make, you will need to spin down your containers with -v to destroy your state before starting a new one with make dev.

Editing code for the back-end processes (alpaca, milliner, etc) is more complicated. Please ask on the #isle Slack channel and help us improve this documentation!

Testing a Pull Request¶

Islandora modules in the codebase/web/contrib/modules folder are already set up with git and the origin remote is the canonical Islandora repository. You can follow the command-line instructions for testing pull requests available on Github. When finished, don't forget to git checkout main (or the default branch if not named main) so you can pull new code.

Updating ISLE¶

Documentation to come - see Issue #121

Drupal Updates¶

to come

Module Updates (non-Islandora)¶

to come

Module Updates (Islandora)¶

to come

Backend Providers (solr, mariadb, etc)¶

to come

Updating the whole isle-dc repo¶

to come

Estimated reading time: 16 minutes

Did you know that Docker Desktop now offers support for developers subscribed to a Pro or a Team plan? Click here to learn more.

This page contains information on how to diagnose and troubleshoot Docker Desktop issues, request Docker Desktop support (Pro and Team plan users only), send logs and communicate with the Docker Desktop team, use our forums and Success Center, browse and log issues on GitHub, and find workarounds for known problems.

Troubleshoot

Choose > Troubleshootfrom the menu bar to see the troubleshoot options.

The Troubleshoot page contains the following options:

  • Restart Docker Desktop: Select to restart Docker Desktop.

  • Support: Developers on Pro and Team plans can use this option to send a support request. Other users can use this option to diagnose any issues in Docker Desktop. For more information, see Diagnose and feedback and Support.

  • Reset Kubernetes cluster: Select this option to delete all stacks and Kubernetes resources. For more information, see Kubernetes.

  • Clean / Purge data: Select this option to delete container and image data. Choose whether you’d like to delete data from Hyper-V, WSL 2, or Windows Containers and then click Delete to confirm.

  • Reset to factory defaults: Choose this option to reset all options onDocker Desktop to their initial state, the same as when Docker Desktop was first installed.

Diagnose and feedback

In-app diagnostics

If you experience issues for which you do not find solutions in thisdocumentation, on Docker Desktop for Windows issues onGitHub, or the Docker Desktop for Windowsforum, we can help youtroubleshoot the log data. Before reporting an issue, we recommend that you read the information provided on this page to fix some common known issues.

  1. Choose > Troubleshootfrom the menu.
  2. Sign into Docker Desktop. In addition, ensure you are signed into your Docker account.
  3. Click Get Support. This opens the in-app Diagnose & Support (Diagnose & Feedback for free users) page and starts collecting the diagnostics.

  4. When the diagnostics collection process is complete, click Upload to upload your diagnostics to Docker Desktop.
  5. When the diagnostics have been uploaded, Docker Desktop prints a Diagnostic ID. Copy this ID.
  6. If you have subscribed to a Pro or a Team plan, click Get support. This opens the Docker Desktop support form. Fill in the information required and add the ID you copied earlier to the Diagnostics ID field. Click Submit to request Docker Desktop support.

    Note

    You must be signed in to Docker Desktop using your Pro or Team plan credentials to access the support form. For information on what’s covered as part of Docker Desktop support, see Support.

  7. If you are not subscribed to a Pro or a team plan, you can click Upgrade your account to upgrade your existing account.

    Alternatively, click Report an issue to open a new Docker Desktop issue on GitHub. This opens Docker Desktop for Windows on GitHub in your web browser in a ‘New issue’ template. Complete the information required and ensure you add the diagnostic ID you copied earlier. Click submit new issue to create a new issue.

Diagnosing from the terminal

On occasions it is useful to run the diagnostics yourself, for instance ifDocker Desktop for Windows cannot start.

Failed port is already allocated issue 1114 docker for mac github windows

First locate the com.docker.diagnose, that should be in C:ProgramFilesDockerDockerresourcescom.docker.diagnose.exe.

To create and upload diagnostics in Powershell, run:

After the diagnostics have finished, you should have the following output,containing your diagnostic ID:

Troubleshooting topics

Make sure certificates are set up correctly

Docker Desktop ignores certificates listed under insecure registries, anddoes not send client certificates to them. Commands like docker run thatattempt to pull from the registry produces error messages on the command line,like this:

As well as on the registry. For example:

For more about using client and server side certificates, seeHow do I add custom CA certificates?and How do I add client certificates? in theGetting Started topic.

Volumes

Permissions errors on data directories for shared volumes

When sharing files from Windows, Docker Desktop sets permissions on shared volumesto a default value of 0777(read, write, execute permissions for user and for group).

The default permissions on shared volumes are not configurable. If you areworking with applications that require permissions different from the sharedvolume defaults at container runtime, you need to either use non-host-mountedvolumes or find a way to make the applications work with the default filepermissions.

See also,Can I change permissions on shared volumes for container-specific deployment requirements?in the FAQs.

Volume mounting requires shared folders for Linux containers

If you are using mounted volumes and get runtime errors indicating anapplication file is not found, access is denied to a volume mount, or a servicecannot start, such as when using Docker Compose,you might need to enable shared folders.

With the Hyper-V backend, mounting files from Windows requires shared folders for Linux containers. Click and then Settings > Shared Folders and share the folder that contains theDockerfile and volume.

Support for symlinks

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github

Symlinks work within and across containers. To learn more, see How do symlinks work on Windows? in the FAQs.

Avoid unexpected syntax errors, use Unix style line endings for files in containers

Any file destined to run inside a container must use Unix style n lineendings. This includes files referenced at the command line for builds and inRUN commands in Docker files.

Docker containers and docker build run in a Unix environment, so files incontainers must use Unix style line endings: n, not Windows style: rn.Keep this in mind when authoring files such as shell scripts using Windowstools, where the default is likely to be Windows style line endings. Thesecommands ultimately get passed to Unix commands inside a Unix based container(for example, a shell script passed to /bin/sh). If Windows style line endingsare used, docker run fails with syntax errors.

For an example of this issue and the resolution, see this issue on GitHub:Docker RUN fails to execute shellscript.

Virtualization

Your machine must have the following features for Docker Desktop to function correctly.

WSL 2 and Windows Home

  1. Virtual Machine Platform
  2. Virtualization enabled in the BIOS
  3. Hypervisor enabled at Windows startup

Hyper-V

On Windows 10 Pro or Enterprise, you can also use Hyper-V with the following features enabled:

  1. Hyper-Vinstalled and working
  2. Virtualization enabled in the BIOS
  3. Hypervisor enabled at Windows startup

Docker Desktop requires Hyper-V as well as the Hyper-V Module for WindowsPowershell to be installed and enabled. The Docker Desktop installer enablesit for you.

Docker Desktop also needs two CPU hardware features to use Hyper-V: Virtualization and Second Level Address Translation (SLAT), which is also called Rapid Virtualization Indexing (RVI). On some systems, Virtualization must be enabled in the BIOS. The steps required are vendor-specific, but typically the BIOS option is called Virtualization Technology (VTx) or something similar. Run the command systeminfo to check all required Hyper-V features. See Pre-requisites for Hyper-V on Windows 10 for more details.

To install Hyper-V manually, see Install Hyper-V on Windows 10. A reboot is required after installation. If you install Hyper-V without rebooting, Docker Desktop does not work correctly.

From the start menu, type Turn Windows features on or off and press enter.In the subsequent screen, verify that Hyper-V is enabled.

Virtualization must be enabled

In addition to Hyper-V or WSL 2, virtualization must be enabled. Check thePerformance tab on the Task Manager:

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github

If you manually uninstall Hyper-V, WSL 2 or disable virtualization,Docker Desktop cannot start. See Unable to run Docker for Windows onWindows 10 Enterprise.

Hypervisor enabled at Windows startup

If you have completed the steps described above and are still experiencingDocker Desktop startup issues, this could be because the Hypervisor is installed,but not launched during Windows startup. Some tools (such as older versions of Virtual Box) and video game installers disable hypervisor on boot. To reenable it:

  1. Open an administrative console prompt.
  2. Run bcdedit /set hypervisorlaunchtype auto.
  3. Restart Windows.

You can also refer to the Microsoft TechNet article on Code flow guard (CFG) settings.

Windows containers and Windows Server

Docker Desktop is not supported on Windows Server. If you have questions about how to run Windows containers on Windows 10, seeSwitch between Windows and Linux containers.

A full tutorial is available in docker/labs onGetting Started with Windows Containers.

You can install a native Windows binary which allows you to develop and runWindows containers without Docker Desktop. However, if you install Docker this way, you cannot develop or run Linux containers. If you try to run a Linux container on the native Docker daemon, an error occurs:

Running Docker Desktop in nested virtualization scenarios

Docker Desktop can run inside a Windows 10 VM running on apps like Parallels or VMware Fusion on a Mac provided that the VM is properly configured. However, problems and intermittent failures may still occur due to the way these apps virtualize the hardware. For these reasons, Docker Desktop is not supported in nested virtualization scenarios. It might workin some cases, and not in others.

For best results, we recommend you run Docker Desktop natively on a Windows system (to work with Windows or Linux containers), or on Mac to work with Linux containers.

If you still want to use nested virtualization

  • Make sure nested virtualization support is enabled in VMWare or Parallels.Check the settings in Hardware > CPU & Memory > Advanced Options > Enablenested virtualization (the exact menu sequence might vary slightly).

  • Configure your VM with at least 2 CPUs and sufficient memory to run yourworkloads.

  • Make sure your system is more or less idle.

  • Make sure your Windows OS is up-to-date. There have been several issues withsome insider builds.

  • The processor you have may also be relevant. For example, Westmere based MacPros have some additional hardware virtualization features over Nehalem basedMac Pros and so do newer generations of Intel processors.

Typical failures we see with nested virtualization

  • Slow boot time of the Linux VM. If you look in the logs and find some entriesprefixed with Moby. On real hardware, it takes 5-10 seconds to boot theLinux VM; roughly the time between the Connected log entry and the *Starting Docker ... [ ok ] log entry. If you boot the Linux VM inside aWindows VM, this may take considerably longer. We have a timeout of 60s or so.If the VM hasn’t started by that time, we retry. If the retry fails we printan error. You can sometimes work around this by providing more resources tothe Windows VM.

  • Sometimes the VM fails to boot when Linux tries to calibrate the time stampcounter (TSC). This process is quite timing sensitive and may fail whenexecuted inside a VM which itself runs inside a VM. CPU utilization is alsolikely to be higher.

  • Ensure “PMU Virtualization” is turned off in Parallels on Macs. Check thesettings in Hardware > CPU & Memory > Advanced Settings > PMUVirtualization.

Networking issues

IPv6 is not (yet) supported on Docker Desktop.

Workarounds

Reboot

Restart your PC to stop / discard any vestige of the daemon running from thepreviously installed version.

Unset DOCKER_HOST

The DOCKER_HOST environmental variable does not need to be set. If you usebash, use the command unset ${!DOCKER_*} to unset it. For other shells,consult the shell’s documentation.

Make sure Docker is running for webserver examples

For the hello-world-nginx example and others, Docker Desktop must berunning to get to the webserver on http://localhost/. Make sure that theDocker whale is showing in the menu bar, and that you run the Docker commands ina shell that is connected to the Docker Desktop Engine. Otherwise, you might start the webserver container but get a “web pagenot available” error when you go to docker.

How to solve port already allocated errors

If you see errors like Bind for 0.0.0.0:8080 failed: port is already allocatedor listen tcp:0.0.0.0:8080: bind: address is already in use ...

These errors are often caused by some other software on Windows using thoseports. To discover the identity of this software, either use the resmon.exeGUI and click “Network” and then “Listening Ports” or in a Powershell usenetstat -aon | find /i 'listening ' to discover the PID of the processcurrently using the port (the PID is the number in the rightmost column). Decidewhether to shut the other process down, or to use a different port in yourdocker app.

Docker Desktop fails to start when anti-virus software is installed

Some anti-virus software may be incompatible with Hyper-V and MicrosoftWindows 10 builds. The conflicttypically occurs after a Windows update andmanifests as an error response from the Docker daemon and a Docker Desktop start failure.

For a temporary workaround, uninstall the anti-virus software, orexplore other workarounds suggested on Docker Desktop forums.

Support

Docker Desktop offers support for developers subscribed to a Pro or a Team plan. Click here to upgrade your existing account.

This section contains instructions on how to get support, and covers the scope of Docker Desktop support.

How do I get Docker Desktop support?

If you have subscribed to a Pro and Team account, please raise a ticket through Docker Desktop support.

Docker Community users can get support through our Github repos for-win and for-mac, where we respond on a best-effort basis.

What support can I get?

If you are a Pro or a Team user, you can request for support on the following types of issues:

  • Desktop upgrade issues
  • Desktop installation issues
    • Enabling virtualization in BIOS
    • Enabling Windows features
    • Installation crashes
    • Failure to launch Docker Desktop on first run
  • Usage issues
    • Crash closing software
    • Docker Desktop not behaving as expected
  • Configuration issues
  • Basic product ‘how to’ questions such as ‘how to work efficiently on WSL 2’

What is not supported?

Docker Desktop excludes support for the following types of issues:

  • Use on or in conjunction with hardware or software other than that specified in the applicable documentation
  • Running on unsupported operating systems, including beta/preview versions of operating systems
  • Support for the Docker engine, Docker CLI, or other bundled Linux components
  • Support for Kubernetes
  • Features labeled as experimental
  • System/Server administration activities
  • Supporting Desktop as a production runtime
  • Scale deployment/multi-machine installation of Desktop
  • Routine product maintenance (data backup, cleaning disk space and configuring log rotation)
  • Third-party applications not provided by Docker
  • Altered or modified Docker software
  • Defects in the Docker software due to hardware malfunction, abuse, or improper use
  • Any version of the Docker software other than the latest version
  • Reimbursing and expenses spent for third-party services not provided by Docker
  • Docker Support excludes training, customization, and integration

What versions are supported?

We currently only offer support for the latest version of Docker Desktop. If you are running an older version, you may be asked to upgrade before we investigate your support request.

How many machines can I get support for Docker Desktop on?

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github Software

As a Pro user you can get support for Docker Desktop on a single machine.As a Team, you can get support for Docker Desktop for the number of machines equal to the number of seats as part of your plan.

What OS’s are supported?

Docker Desktop is available for Mac and Windows. The supported version information can be found on the following pages:

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github Update

Can I run Docker Desktop on Virtualized hardware?

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github Key

No, currently this is unsupported and against the terms of use.

Failed Port Is Already Allocated Issue 1114 Docker For Mac Github Version

windows, troubleshooting, logs, issues