Skip to content
Snippets Groups Projects
README.md 4.71 KiB
Newer Older
  • Learn to ignore specific revisions
  • jurgenhaas's avatar
    jurgenhaas committed
    # LakeDropsDrupalDev - L3D
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    Provides fully configured Docker images for local Drupal development where your local host requires nothing else than Docker being installed but no PHP, Composer or any other tool on this planet. It simply works.
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    ## Prerequisites
    
    Nothing else than docker being installed on your host. You don't need any other tool - none!
    
    You can install the tool with the following command:
    
    docker run -v /usr/local/bin:/setup --rm registry.lakedrops.com/docker/l3d/setup:latest
    
    This will install the script `l3d` into the given directory `/usr/local/bin` from where it is executable everywhere on your host (assuming this path being in your search path). If you want that script to be installed elsewhere then provide that alternative path in the install command above. Instead of `latest` you can also start with any other specific version number of this tool. You can find all available version strings in the [tag list](https://gitlab.lakedrops.com/docker/l3d/tags) of this project.
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    ## Quick start MacOS
    
    Here we have to circumwent some limitations that come with Docker for Mac:
    
    1. Docker for Mac is not able to mount certain directories and one of those is anything underneath `/usr`. Therefore you have to use a different directory where the L3D script and some additional files get stored.
    2. Docker for Mac does not properly mount sockets such that SSH agent can not be used inside of Docker containers the same way this is being done on Linux platforms. There are many workarounds available and we have integrated the approach from [mariusgrigaitis](https://github.com/mariusgrigaitis/docker-mac-ssh-auth-sock) into this project.
    
    This requires [socat](https://linux.die.net/man/1/socat). You can install that with `sudo brew install socat` or `sudo port install socat` or any other method that is applicable to you specific Mac. After installation make sure that `socat` can be found in your search path. If it got installed in a directory that isn't in the path, you can create a symbolic link to it into `/usr/local/bin`.
    
    Then use the following command to install L3D (replace `myname` with your correct username:
    
    ```bash
    docker run -v /User/myname/bin:/setup --rm registry.lakedrops.com/docker/l3d/setup:latest
    ```
    
    Then make sure that the directory `/User/myname/bin` is included in the PATH environment variable or create a symbolic link in `/usr/local/bin`. If you work with a symbolic link, MacOS also requires [coreutils](https://de.wikipedia.org/wiki/GNU_Core_Utilities) which can be installed with `sudo brew install coreutils` or `sudo port install coreutils`.
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    richardpapp's avatar
    richardpapp committed
    Go to the project root for which you want to use **L3D** and execute the installed script: simply type `l3d` at the command prompt.
    
    It will ask you for the PHP version (input `7.0`, `7.1` or `7.2`), the project name and template to be used. Then it will download the matching **L3D** image and start a container for you.
    
    Inside the container you'll find the directory `/drupal` which contains everything from your project's root. You can work from there by using these available tools:
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    | Tool | Command | Shortcut |
    | --- | --- | --- |
    | Ahoy | `ahoy` | `a` |
    | Composer | `composer` | `c` |
    | Docker | `docker` | |
    | Docker Composer | `docker-compose` | `d-c` |
    | DorgFlow | `dorgflow` | |
    | Drush | `drush` | `d` |
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    richardpapp's avatar
    richardpapp committed
    ### LakeDrops Drupal 8 project template
    
    If you have chosen the LakeDrops Drupal 8 project template, type 'a d4d up' at the command prompt within the container to start the remaining containers.
    
    'drush status' will then show you the URL of your project.
    
    
    ## Update the start script
    
    
    jurgenhaas's avatar
    jurgenhaas committed
    Just call `l3d selfupdate` and the start script will be updated from the original repository. This will also update all your existing **L3D** images and remove the outdated containers so that they will be recreated the next timne you're going to use them.
    
    ## Working with Git credentials
    
    In order to commit and push with git you have to at least configure your email address and username for the git client. If you configure those globally on your host, each of the **L3D** containers will inherit those settings and there is nothing that needs to be done inside the container.
    
    To configure those credentials, use these commands:
    
    ```bash
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
    ```
    
    
    ## Getting help
    
    Calling `l3d help` displays information about **L3D** and provides a link to further details.
    
    
    ## Examples
    
    ### Start a new project
    
    ```bash
    cd /var/www
    mkdir testproject1
    cd testproject1
    l3d
    ```
    
    
    jurgenhaas's avatar
    jurgenhaas committed
    You will be presented with a list of options on how to get started and you can simply follow the instructions on screen.
    
    
    ### Use with an existing project
    
    ```bash
    cd /path/to/your/project
    l3d
    composer update
    ```