Skip to content

Commit 4d19c57

Browse files
committed
build: Support docker to build binary package
Usage: ``` docker build . ``` This can be then declined for several arch, elsewhere. Change-Id: I79000463955d16eec8809c870f7d02c60da53432 Bug: TryGhost#418 Forwarded: TryGhost#1112 TryGhost#1028 Origin: https://github.com/tizenteam/node-sqlite3 Signed-off-by: Philippe Coval <[email protected]>
1 parent 7eda5ee commit 4d19c57

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.dockerignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#.dockerignore
2+
*~
3+
Dockerfile
4+
.git/
5+
6+
#.gitignore
7+
*.dylib
8+
*.so
9+
*.o
10+
*.lo
11+
*.Makefile
12+
*.target.gyp.mk
13+
lib/binding
14+
build
15+
out
16+
Release
17+
Debug
18+
node_modules
19+
.deps
20+
Makefile.gyp
21+
gyp-mac-tool
22+
.dirstamp
23+
npm-debug.log
24+
test/support/big.db
25+
test/tmp
26+
test/nw/app.nw
27+
.DS_Store
28+
.idea
29+
.dtps
30+
local.env
31+
.mason
32+
.eslintrc.js
33+
setup.sh

Dockerfile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/echo docker build . -f
2+
# -*- coding: utf-8 -*-
3+
#{
4+
# ISC License
5+
# Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
6+
# Copyright (c) 1995-2003 by Internet Software Consortium
7+
# Permission to use, copy, modify, and /or distribute this software
8+
# for any purpose with or without fee is hereby granted,
9+
# provided that the above copyright notice
10+
# and this permission notice appear in all copies.
11+
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
13+
# OF MERCHANTABILITY AND FITNESS.
14+
# IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
15+
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
17+
# WHETHER IN AN ACTION OF CONTRACT,
18+
# NEGLIGENCE OR OTHER TORTIOUS ACTION,
19+
# ARISING OUT OF OR IN CONNECTION WITH THE USE
20+
# OR PERFORMANCE OF THIS SOFTWARE.
21+
#}
22+
23+
FROM ubuntu:latest
24+
MAINTAINER Philippe Coval ([email protected])
25+
26+
ENV DEBIAN_FRONTEND noninteractive
27+
ENV LC_ALL en_US.UTF-8
28+
ENV LANG ${LC_ALL}
29+
30+
RUN echo "#log: Configuring locales" \
31+
&& set -x \
32+
&& apt-get update -y \
33+
&& apt-get install -y locales \
34+
&& echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \
35+
&& locale-gen ${LC_ALL} \
36+
&& dpkg-reconfigure locales \
37+
&& sync
38+
39+
ENV project node-sqlite3
40+
41+
RUN echo "#log: ${project}: Setup system" \
42+
&& set -x \
43+
&& apt-get update -y \
44+
&& apt-get install -y \
45+
curl \
46+
sudo \
47+
build-essential \
48+
python \
49+
&& apt-get clean \
50+
&& NVM_VERSION="v0.33.8" \
51+
&& NODE_VERSION="--lts=carbon" \
52+
&& curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \
53+
&& which nvm || . ~/.bashrc \
54+
&& nvm install ${NODE_VERSION} \
55+
&& nvm use ${NODE_VERSION} \
56+
&& sync
57+
58+
ADD . /usr/local/${project}/${project}
59+
WORKDIR /usr/local/${project}/${project}
60+
RUN echo "#log: ${project}: Preparing sources" \
61+
&& set -x \
62+
&& which npm || . ~/.bashrc \
63+
&& npm install || cat npm-debug.log \
64+
&& npm install \
65+
&& npm install --unsafe-perm --build-from-source \
66+
&& sync
67+
68+
WORKDIR /usr/local/${project}/${project}
69+
RUN echo "#log: ${project}: Building sources" \
70+
&& set -x \
71+
&& which npm || . ~/.bashrc \
72+
&& npm run pack \
73+
&& npm pack \
74+
&& find build/stage/ -type f \
75+
&& sync
76+

0 commit comments

Comments
 (0)