I'm trying to start localstack in a containerized Jenkins build agent for unit testing. In other words, trying to start the localstack docker container from within a docker container. We do this all the time with other images, using the method of mounting `/var/run/docker.sock` in the "parent" container, but localstack will not start.

I get this error:

```
2019-11-08T18:53:53:ERROR:localstack.services.generic_proxy: Exception running proxy on port 8081: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem' Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 384, in run_cmd
    combined_file, cert_file_name, key_file_name = GenericProxy.create_ssl_cert(serial_number=self.port)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 401, in create_ssl_cert
    return generate_ssl_cert(SERVER_CERT_PEM_FILE, serial_number=serial_number)
  File "/opt/code/localstack/localstack/utils/common.py", line 828, in generate_ssl_cert
    save_file(target_file, file_content)
  File "/opt/code/localstack/localstack/utils/common.py", line 642, in save_file
    with open(file, mode) as f:
PermissionError: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem'
```

Port 8081 is not already in use, and `/tmp/localstack` is writable, so I don't understand why it's getting permission denied.
"""
    Extracts a Zipfile entry and preserves permissions
    """
    zip_ref.extract(file_entry.filename, path=target_dir)
    out_path = os.path.join(target_dir, file_entry.filename)
    perm = file_entry.external_attr >> 16
    os.chmod(out_path, perm or 0o777)
def is_jar_archive(content):
    """ Determine whether `content` contains valid zip bytes representing a JAR archive
        that contains at least one *.class file and a META-INF/MANIFEST.MF file. """
    try:
        with tempfile.NamedTemporaryFile() as tf:
            tf.write(content)
            tf.flush()
            with zipfile.ZipFile(tf.name, 'r') as zf:
                class_files = [e for e in zf.infolist() if e.filename.endswith('.class')]
                manifest_file = [e for e in zf.infolist() if e.filename.upper() == 'META-INF/MANIFEST.MF']
                if not class_files or not manifest_file:
                    return False
    except Exception:
        return False
    return True
def is_root():
    out = run('whoami').strip()
    return out == 'root'
def cleanup_resources():
    cleanup_tmp_files()
    cleanup_threads_and_processes()
def generate_ssl_cert(target_file=None, overwrite=False, random=False, return_content=False, serial_number=None):