alexfedosov / vapor-dokku-deploy-example

Example of minimal vapor application which can be deployed with dokku
MIT License
3 stars 0 forks source link

Problem deploying #1

Closed ksmandersen closed 7 years ago

ksmandersen commented 7 years ago

Hi šŸ‘‹ . This example project is really awesome! I love dokku and would love to use it for my swift server projects. I tried replicating your setup here but get the following error when attempting to push:

Counting objects: 379, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (347/347), done.
Writing objects: 100% (379/379), 112.45 KiB | 0 bytes/s, done.
Total 379 (delta 183), reused 0 (delta 0)
-----> Cleaning up...
-----> Building api from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/vapor-community/heroku-buildpack.git
=====> Detected Framework: Swift
remote: Cloning into 'swiftenv'...
       Swift 3 Heroku Installer
       šŸ”¢  Version: 3.1.1
       šŸ–„  Operating System: ubuntu1404
       šŸ“¦ Installing Swiftenv
remote: Cloning into '/app/.swiftenv'...
       šŸ¦ Installing Swift
       Downloading https://swift.org/builds/swift-3.1.1-release/ubuntu1404/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu14.04.tar.gz
       /tmp/swiftenv-3.1.1-herokuishuser /tmp/build
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote: 100  118M  100  118M    0     0  2734k      0  0:00:44  0:00:44 --:--:-- 1401k
       /tmp/build
       3.1.1 has been installed.
       āœ…  Done
       precompile
-----> Building Package ... this will take a while
remote: /app/.swiftenv/versions/3.1.1/usr/bin/swift-build: error while loading shared libraries: libicuuc.so.52: cannot open shared object file: No such file or directory

I am running dokku 0.10.2

Hope you have some insight into my problem

alexfedosov commented 7 years ago

@ksmandersen seems it is not related to dokku actually but looks like Swift compiler issue while building your project. I think you could try to install libicu first on your Linux machine apt-get install libicu-dev or apt-get install libicu52

ksmandersen commented 7 years ago

@alexfedosov Yeah, I googled around and saw that. I tried that but keep getting the errors.

From my limited understanding that wont solve the problem since (i am guessing) the compilation and linking of the app happens in the docker container it builds. So you would need to run the apt-get install ibicu-dev inside that container. Is it possible to do that as a step in the buildpack?

alexfedosov commented 7 years ago

@ksmandersen I can't test it now but have an idea that basically you fork the buildpack and add apt-get install libicu somewhere inside bash script. I would try to put it there: https://github.com/vapor-community/heroku-buildpack/blob/master/bin/steps/swift-build) as a second line. Let me know if it works, please.

ksmandersen commented 7 years ago

@alexfedosov Thanks for the help. I'll try that out later fore sure.

I the meantime i found this dokku plugin that lets you inject deb packages into the container: https://github.com/F4-Group/dokku-apt. Using that I fixed the linking error.