Commit da170b14 authored by Philippe Coval's avatar Philippe Coval Committed by Phil Coval

build: Support docker for unsupported distros

Some OS may expect some issues on building iotivity,
so developers can fallback to use Ubuntu LTS,
in a docker container.

This can be also useful to validate snapshot builds.

Usage:

    docker build .

This can be run also from outside sources:

    docker build $url

If merged, more steps to come later.

Bug: https://jira.iotivity.org/browse/IOT-524
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/23239/
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/fedora
Change-Id: I921e2e9c18567871ac0db1e94db5b6e9ab359427
Signed-off-by: default avatarPhilippe Coval <philippe.coval@osg.samsung.com>
parent 11c56a8a
#******************************************************************
#
# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
# Copyright 2017 Samsung Electronics France SAS
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dockerfile
*~
tmp/
run.sh
# Docker: Ignore .git files
.git*
# Here is a copy of .gitignore without extlibs
# Ignore output dirs
/release
resource/release
resource/csdk/release
resource/csdk/libcoap-4.1.1/release/
resource/examples/release
resource/examples/debug
/debug
resource/debug
resource/csdk/debug/
resource/csdk/libcoap-4.1.1/debug/
resource/csdk/libcoap-4.1.1/linux/
resource/csdk/linux
resource/csdk/stack/samples/linux/SimpleClientServer/debug/
resource/csdk/stack/samples/linux/SimpleClientServer/release/
resource/csdk/connectivity/build/out/
# Ignore autogenerated files
# better not to ignore this one:
#resource/c_common/iotivity_config.h
resource/csdk/connectivity/src/bt_le_adapter/linux/org.iotivity.gatt.service.conf
service/notification/android/.gradle/
service/notification/android/build/
service/notification/android/notification-service/build/
service/notification/android/notification-service/src/main/obj/
# Ignore any object files
*.o
*.os
*.obj
# Ignore libraries
*.a
*.so
# Ignore Eclipse workspace files
*.settings/
# Ignore proguard file generated by Eclipse
proguard-project.txt
# Ignore Project files for IDEA
*.iml
.idea
# Ignore CTags default data
tags
# Ignore dependencies folder, which should be generated
dependencies/
dep/
#ignore Klocwork stuff
.kwlp/
.kwps/
#ignore various swap files
*.swp
# Ignore SCons generated files and directories
.scon*
config.log
os
out/
platform
iotivity.pc
tmp/
*.tmp
*.tmp.*
# Ignore GCov generated files
*.gcda
*.gcno
# Ignore downloaded dependencies
*.tgz
*.zip
*.bin
# Ignore editor (e.g. Emacs) backup and autosave files
*~
*#*#
*.orig
.cproject
.gradle/
.project
# Ignore byte-compiled Python scripts
*.pyc
# Ignore Valgrind generated files.
*.memcheck
# Ignore generated files
*.dat
# Ignore generated documentation files
docs/c-doc/docs/
docs/c-doc/doxygen.log
docs/cpp-doc/docs/
docs/cpp-doc/doxygen.log
# Ignore debian generated files
debian/files
debian/*.debhelper.log
debian/*.substvars
debian/iotivity*/*
debian/tmp/*
#!/bin/echo docker build . -f
# -*- coding: utf-8 -*-
#{
# Copyright 2017 Samsung Electronics France SAS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}
FROM debian:stable
MAINTAINER Philippe Coval (philippe.coval@osg.samsung.com)
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL en_US.UTF-8
ENV LANG ${LC_ALL}
RUN echo "#log: Configuring locales" \
&& set -x \
&& apt-get update \
&& apt-get install -y locales \
&& echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \
&& locale-gen ${LC_ALL} \
&& dpkg-reconfigure locales \
&& sync
ENV project iotivity
ARG SCONSFLAGS
ENV SCONSFLAGS ${SCONSFLAGS:-"VERBOSE=1 ERROR_ON_WARN=False"}
ARG prefix
ENV prefix ${prefix:-/usr/}
ARG destdir
ENV destdir ${destdir:-/usr/local/opt/${project}}
RUN echo "#log: ${project}: Setup system" \
&& set -x \
&& apt-get update -y \
&& apt-get install -y \
devscripts \
debhelper \
base-files \
\
autoconf \
automake \
autotools-dev \
bash \
git \
libtool \
make \
python-dev \
scons \
sudo \
unzip \
valgrind \
wget \
\
libboost-date-time-dev \
libboost-iostreams-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
libbz2-dev \
libcurl4-openssl-dev \
libglib2.0-dev \
libicu-dev \
libsqlite3-dev \
uuid-dev \
&& apt-get clean \
&& sync
ADD . /usr/local/src/${project}
WORKDIR /usr/local/src/${project}
RUN echo "#log: ${project}: Preparing sources" \
&& set -x \
&& uname -a \
&& cat /etc/os-release \
&& scons --version \
&& gcc --version \
&& g++ --version \
&& [ ! -x prep.sh ] || EXEC_MODE=true ./prep.sh \
&& sync
RUN echo "#log: ${project}: Building" \
&& set -x \
&& scons -h \
&& scons --prefix="${prefix}" \
|| scons --prefix="${prefix}" --debug=stacktrace \
&& sync
RUN echo "#log: ${project}: Installing" \
&& set -x \
&& scons install --prefix="${prefix}" --install-sandbox="${destdir}" \
|| scons install --prefix="${prefix}" --install-sandbox="${destdir}" --debug=stacktrace \
&& find ${destdir} \
&& sync
RUN echo "#log: ${project}: Cleaning objects" \
&& set -x \
&& scons -c \
&& sync
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment