Skip to content

Commit

Permalink
Statically link libcurl on Linux builds (Kong#879)
Browse files Browse the repository at this point in the history
* Statically linked Curl for linux builds with Docker

* Test Travis Docker

* Try fix blocking i/o

* Try a package

* Fixed linux build

* Try hack

* Fix icons?

* Icon color

* Re-enable osx builds

* Remove libcurl3 dependency requirements

* Update electronbuilder config
  • Loading branch information
gschier authored Apr 20, 2018
1 parent 2622cb1 commit 40b2bf3
Show file tree
Hide file tree
Showing 14 changed files with 3,593 additions and 1,398 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/node_modules
**/build
**/dist
**/.git
**/.github
screenshots
31 changes: 15 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@ matrix:
- os: linux
sudo: required
dist: trusty
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
install:
- npm install 7zip-bin-linux > /dev/null
env:
- DOCKER_COMPOSE_VERSION=1.20.1
# Get newer docker-compose
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# Some hack to get stdout to be blocking
before_deploy:
- python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
- docker-compose build package
- docker-compose run package
- os: osx
install:
- npm install 7zip-bin-mac > /dev/null
env:
- CSC_LINK=$MAC_CSC_LINK
- CSC_KEY_PASSWORD=$MAC_CSC_KEY_PASSWORD

addons:
apt:
packages:
- libcurl4-openssl-dev
- snapd
- git-all
- icnsutils
- graphicsmagick
before_deploy:
- npm run app-package

cache:
directories:
Expand All @@ -38,9 +40,6 @@ script:
- npm run bootstrap
- npm test

before_deploy:
- npm run app-package

deploy:
provider: releases
api_key: $GITHUB_TOKEN
Expand Down
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM ubuntu:14.04

# Install core deps
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y \
build-essential \
libssl-dev \
autoconf \
libtool \
wget

# Build nghttp2 from source (for Curl)
RUN wget -q https://github.com/nghttp2/nghttp2/releases/download/v1.31.1/nghttp2-1.31.1.tar.gz -O ./nghttp2.tar.gz \
&& mkdir -p /src/nghttp2 \
&& tar -xvf nghttp2.tar.gz -C /src/nghttp2 --strip 1 \
&& cd /src/nghttp2 \
&& ./configure \
&& make \
&& make install \
&& ldconfig

# Build Curl from source
RUN wget -q https://github.com/curl/curl/releases/download/curl-7_59_0/curl-7.59.0.tar.gz -O ./curl.tar.gz \
&& mkdir -p /src/curl \
&& tar -xvf curl.tar.gz -C /src/curl --strip 1 \
&& cd /src/curl \
&& ./buildconf \
&& ./configure \
--disable-shared \
--enable-static \
--with-ssl \
--with-zlib \
--with-nghttp2 \
--enable-ipv6 \
--enable-unix-sockets \
&& make \
&& make install \
&& ldconfig

# Install Node
RUN wget -O- https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs graphicsmagick icnsutils \
&& npm install --no-save 7zip-bin-linux app-builder-bin-linux

# Setup dirs
ADD . /src/insomnia
WORKDIR /src/insomnia
VOLUME /src/insomnia/packages/insomnia-app/dist

# Install root project dependencies
RUN npm run bootstrap

# Define build command
CMD npm run app-package
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
package:
build: .
volumes:
- ./packages/insomnia-app/dist:/src/insomnia/packages/insomnia-app/dist
14 changes: 0 additions & 14 deletions packages/insomnia-app/.electronbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,5 @@
"deb",
"tar.gz"
]
},
"snap": {
"stagePackages": ["default", "libcurl3"]
},
"deb": {
"depends": [
"gconf2",
"gconf-service",
"libnotify4",
"libappindicator1",
"libxtst6",
"libnss3",
"libcurl3"
]
}
}
Binary file removed packages/insomnia-app/app/icons/icon.icns
Binary file not shown.
Binary file removed packages/insomnia-app/app/icons/icon.ico
Binary file not shown.
Binary file added packages/insomnia-app/app/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 40b2bf3

Please sign in to comment.