Skip to content

Commit 7b457d1

Browse files
committed
fixed travis via docker
1 parent f76bcd3 commit 7b457d1

File tree

3 files changed

+15
-80
lines changed

3 files changed

+15
-80
lines changed

.travis.yml

+5-79
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,10 @@
1-
language: php
1+
sudo: required
22

3-
compiler:
4-
- gcc
5-
- clang
6-
7-
os:
8-
- linux
9-
# - osx
10-
11-
php:
12-
- 7.0
13-
- 7.1
14-
15-
notifications:
16-
3+
services:
4+
- docker
175

186
before_install:
19-
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
20-
- sudo apt-get -qq update
21-
- sudo apt-get install gcc-4.8 -y -qq
22-
- sudo apt-get install g++-4.8 -y -qq
23-
24-
install:
25-
# OpenCV dependencies - Details available at: http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html
26-
- sudo apt-get install -y build-essential
27-
# Install Cmake
28-
- wget https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz
29-
- tar -zxf cmake-3.8.2.tar.gz
30-
- cd cmake-3.8.2
31-
- ./configure
32-
- make
33-
- sudo make install
34-
- cd ..
35-
36-
- sudo apt-get install -y git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -qq
37-
- sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev -qq
38-
39-
# Download OpenCV-contrib v3.3.0-rc
40-
#- git clone https://github.com/opencv/opencv_contrib.git
41-
#- cd opencv_contrib
42-
#- git checkout 3.3.0-rc
43-
#- cd ..
44-
45-
# Download OpenCV v3.3.0-rc
46-
- git clone https://github.com/opencv/opencv.git
47-
- cd opencv
48-
- git checkout 3.4
49-
50-
# Create a new 'build' folder.
51-
- mkdir build
52-
- cd build
53-
54-
# Set build instructions for Ubuntu distro.
55-
#- cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
56-
- cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
57-
# Run 'make' with four threads.
58-
- make -j6
59-
60-
# Install to OS.
61-
- sudo make install
62-
# Add configuration to OpenCV to tell it where the library files are located on the file system (/usr/local/lib)
63-
- sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
64-
65-
- sudo ldconfig
66-
- echo "OpenCV installed."
67-
68-
# We need to return to the repo "root" folder, so we can then 'cd' into the C++ project folder.
69-
- cd ../../
70-
71-
#addons:
72-
# apt:
73-
# sources:
74-
# - george-edison55-precise-backports
75-
# packages:
76-
# - cmake-data
77-
# - cmake
78-
79-
#Compile
80-
before_script:
81-
- ./travis/compile.sh
7+
- docker pull ubuntu:18.04
828

839
script:
84-
- exit 0
10+
- docker build .

Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:18.04
2+
3+
RUN apt update && export DEBIAN_FRONTEND=noninteractive && apt install -y wget pkg-config cmake git php-cli php-dev
4+
5+
RUN wget https://raw.githubusercontent.com/php-opencv/php-opencv-packages/master/opencv_3.4_amd64.deb && dpkg -i opencv_3.4_amd64.deb && rm opencv_3.4_amd64.deb
6+
7+
RUN git clone https://github.com/php-opencv/php-opencv.git
8+
9+
RUN cd php-opencv && phpize && ./configure --with-php-config=/usr/bin/php-config && make && make install

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Requirements
1212

13-
- OpenCV 3.3.0+
13+
- OpenCV 3.4+
1414
- PHP7.0+
1515

1616

0 commit comments

Comments
 (0)