Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Problems running development in docker #534

Closed
izabellamatos opened this issue Jul 13, 2017 · 2 comments
Closed

Problems running development in docker #534

izabellamatos opened this issue Jul 13, 2017 · 2 comments

Comments

@izabellamatos
Copy link

izabellamatos commented Jul 13, 2017

Hi!

I was testing CTF development version using Docker, but since this Monday I wasnt't able to build the image. I was having this error:

compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-akZxK5/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-yAUmzO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-akZxK5/cryptography/
/usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
The command '/bin/sh -c apt-get update && apt-get install -y rsync curl ca-certificates && chown www-data:www-data $HOME && ./extra/provision.sh -m $MODE -c $TYPE -k $KEY -C $CRT -D $DOMAIN -e $EMAIL -s pwd --docker && rm -f /var/run/hhvm/sock && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*' returned a non-zero code: 1

So, I created a VM with ubuntu and followed the instalation guide and reproduced the same problems. After some searches I discovered that I needed to install "build-essential libssl-dev libffi-dev python-dev curl" . After that the provision script worked fine. In my dockerfile I inserted this line "apt-get build-essential libssl-dev libffi-dev python-dev curl -y".

I don't know if this is a problem with me, but I'm sharing what I've done.

Ps.: I'm using the FBCTF latest version avaliable on GIT

@stevcoll
Copy link

Thanks @izabellamatos! I have tested and confirmed this problem exists in Docker, as well as your solution fixing the issue.

Would you like to submit a PR for this since you came up with the solution? You can add each package name to its own line starting at line 20 (adding the trailing backslash and newline after each one). You will not ned -y as it's implemented at the top of that batch apt-get install. Also curl is already being installed so you won't need that one.

@izabellamatos
Copy link
Author

I've already done the PR!
Sorry the delay.

justinwray added a commit that referenced this issue Aug 4, 2017
…port (#535)

* Separate docker containers per service

* Provision Streamlined, Quick Setup Added, and Multiple Containers Support

* The project now includes a number of "Quick Setup" options to ease the installation or startup process of the platform.  The following Quick Setup modes are available:

  *  Direct Installation - Used when directly installing to the system you are on; this is useful when installing on bare metal, an existing VM, or a cloud-based host.

      * `source ./extra/lib.sh`
      * `quick_setup install <dev/prod>`

  * Multi-Server Direct Installation - Used when directly installing the platform with each service on a separate system; this is useful when installing on bare metal systems, existing VMs, or cloud-based hosts.

    * Database Server (MySQL)
      * `source ./extra/lib.sh`
      * `quick_setup install_multi_mysql <dev/prod>`

    * Cache Server (Memcached)
      * `source ./extra/lib.sh`
      * `quick_setup install_multi_nginx <dev/prod>`

    * HHVM Server (HHVM)
      * `source ./extra/lib.sh`
      * `quick_setup install_multi_hhvm <dev/prod> <IP of MySQL Server> <IP of Memcached Server>`

    * Web Server (Nginx)
      * `source ./extra/lib.sh`
      * `quick_setup install_multi_nginx <dev/prod> <IP of HHVM Server>`

  * Standard Docker Startup - Used when running FBCTF as a single docker container.
      * `source ./extra/lib.sh`
      * `quick_setup start_docker <dev/prod>`

  * Multi-Container Docker Startup - Used when running FBCTF on docker with each service hosted in a separate docker container.
      * `source ./extra/lib.sh`
      * `quick_setup start_docker_multi <dev/prod>`

  * Standard Vagrant Startup - Used when running FBCTF as a single vagrant container.
      * `source ./extra/lib.sh`
      * `quick_setup start_docker <dev/prod>`

  * Multi-Container Vagrant Startup - Used when running FBCTF on vagrant with each service hosted in a separate vagrant container.
      * `source ./extra/lib.sh`
      * `quick_setup start_docker_multi <dev/prod>`

* Each installation platform now supports both Production Mode (prod) and Development Mode (dev).

* The `provision.sh` script has been streamlined and organized based on the services being installed.  The installation process now also includes more logging and error handling.  Common and core functionally has been migrated to `lib.sh` where appropriate.  Color coding has been added to the various output to make quick visual monitoring of the process easier.

* Package installation, specifically the check for existing packages has been updated to fix an issue where packages would sometimes not be installed if a similarly named package was already present on the system.

* The `provision.sh` script now supports separate installations for each service using the `--multiple-servers` and `--server-type` options.

* HHVM configuration has been updated to run HHVM as a network-service.

* Nginx configuration is now included in the platform code base and utilized.

* Docker service startup scripts are included for each of the services:
  * `./extra/mysql/mysql_startup.sh`
  * `./extra/hhvm/hhvm_startup.sh`
  * `./extra/nginx/nginx_startup.sh`

* This PR fixes the docker installation dependencies issue #534.

* This PR includes docker-compose configurations for multi-docker containers, fixing issue #440.

* Services on Docker (both single container and multi-container) are now monitored to ensure they do not fail.

* This PR updates HHVM to the latest stable version for Ubuntu 14.04, HHVM Version 3.18.1, fixing issue #496.

* Attachment/Upload permissions have been corrected across the installation environments.  This fixes issues with improper permissions on Docker and Vagrant while still enforcing secure file permissions.  This should resolve issues like #280 going forward.

* Implemented more strict permissions on he CTF PATH (755 verses 777).

* Fixed long-standing, upstream induced, HHVM socket permission issues (like #229), mostly experienced in Docker or after a restart (resulting in a _502 Bad Gateway_):  facebook/hhvm#6336.  Note that this fix is a temporary workaround until the upstream issue is resolved.

* With the introduction of the latest available version of HHVM and the inclusion of multiple-server support, performance increases should be noticeable.  This should help alleviate issues like #456.

* This PR was derived, in part, from PR #530.

* Added Memcached Service Restart to container service script

* Added logging of PHP/HHVM version to provision script.

* Added logging of PHP Alternatives to provision script.

* Composer is now installed with the HHVM binary instead of PHP.

* Composer Install is run with the HHVM binary instead of PHP.

* The Travis trusty Ubuntu image has been downgraded from `sugilite` to `connie`.

* Updated run_tests.sh to have write permissions to settings.ini

* Set run_tests.sh to use localhost for DB and MC.

* HHVM 3.18+ enforces \HH\FormatString - Invariant calls now are of \HH\FormatString type - All `invariant()` calls that are passing in a variable argument have been updated to use literal strings for the format string.  Invariant passes the second (and subsequent) arguments to `sprintf()`.  The second parameter of `invariant()` must be a literal string, containing placeholders when needed.  More information can be found here:  hhvm/user-documentation#448.  This change ensures the code is strict compliant in HHVM versions 3.18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants