Skip to content

Commit b7aae85

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

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*~
2+
Dockerfile
3+
.git/
4+
tmp/
5+
6+
#{ [[./.gitignore]]
7+
# Standard artifacts
8+
*.swp
9+
.DS_Store
10+
.nyc_output/
11+
.cache-loader/
12+
13+
# Build artifacts
14+
/build
15+
node_modules/
16+
static/js/lib/stm_web.min.js
17+
18+
# Run-time artifacts
19+
.node-persist/
20+
config/local.js
21+
static/uploads
22+
.post_upgrade_complete
23+
/browser-test-output
24+
#} [[./.gitignore]]

Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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}: Preparing sources" \
70+
&& set -x \
71+
&& which npm || . ~/.bashrc \
72+
&& npm run pack \
73+
&& npm pack \
74+
&& find build/stage/ -type f \
75+
&& sync
76+
77+
WORKDIR /usr/local/${project}/${project}
78+
RUN echo "#log: ${project}: Installing sources" \
79+
&& set -x \
80+
&& install -d /usr/local/src/${project}/ \
81+
&& install *.tgz /usr/local/src/${project}/ \
82+
&& cp -rfva ./build/stage/ /usr/local/src/${project}/ \
83+
&& sync

0 commit comments

Comments
 (0)