Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #19 #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# GoCV-compatible OpenCV 4.0.1 Alpine 3.7 Docker images
# GoCV-compatible OpenCV 4.7.0 Alpine 3.18 Docker images

## What's in build-stage image?

- Alpine 3.7
- FFMPEG 4.0
- Golang 1.10
- OpenCV 4.0.1
- OpenCV 4.0.1 contrib packages required by GoCV
- Alpine 3.18
- FFMPEG 4.2.9
- Golang 1.20
- OpenCV 4.7.0
- OpenCV 4.7.0 contrib packages required by GoCV

## What's in runtime image?

- Alpine 3.7
- Alpine 3.18
- Whatever you need there

## Purpose
Expand All @@ -30,7 +30,7 @@ pushd runtime && docker build -t denismakogon/gocv-alpine:4.0.1-runtime .; popd
## Build the build-stage image

```bash
pushd build-stage && docker build -t denismakogon/gocv-alpine:4.0.1-buildstage .; popd
pushd build-stage && docker build -t denismakogon/gocv-alpine:4.7.0-buildstage .; popd
```

## Test sample:
Expand All @@ -45,5 +45,5 @@ docker run --rm -ti denismakogon/gocv-alpine:test
the output should be the following:
```bash
gocv version: 0.18.0
opencv lib version: 4.0.1
opencv lib version: 4.7.0
```
110 changes: 108 additions & 2 deletions build-stage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,114 @@
FROM denismakogon/ffmpeg-alpine:4.0-golang
FROM golang:1.20.4-alpine3.18

LABEL maintainer="Denis Makogon. mail: lildee1991@gmail.com"
LABEL maintainer="Mahdi Imani. <imani.mahdi@gmail.com>"

ENV OPENCV_VERSION=4.0.1
ENV FFMPEG_VERSION=4.2.9

ENV FFMPEG_CORE="bash \
tzdata \
libass \
libstdc++ \
libpng \
libjpeg \
xvidcore \
x264-libs \
x265 \
libvpx \
libvorbis \
opus \
lame \
fdk-aac \
freetype \
libressl \
jasper-libs \
libavc1394 \
yasm"

ENV RUNTIME_DEPS="coreutils \
make \
cmake \
gcc \
g++ \
clang \
linux-headers \
git \
curl"

ENV BUILD_DEPS="fdk-aac-dev \
freetype-dev \
x264-dev \
x265-dev \
yasm-dev \
libogg-dev \
libvorbis-dev \
opus-dev \
libvpx-dev \
lame-dev \
xvidcore-dev \
libass-dev \
libressl-dev \
musl-dev \
build-base \
libjpeg-turbo-dev \
libpng-dev \
jasper-dev \
libavc1394-dev \
libavc1394-dev \
clang-dev"

# FFMPEG
RUN apk update && \
apk add --no-cache apk-tools && \
echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk update && \
apk add --no-cache --virtual .runtime-deps ${RUNTIME_DEPS} && \
apk add --no-cache ${FFMPEG_CORE} && \
apk add --no-cache --virtual .build-deps ${BUILD_DEPS} && \
export SRC=/usr \
DIR=$(mktemp -d) && cd ${DIR} && \
curl -Os http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar xzvf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
cd ffmpeg-${FFMPEG_VERSION} && \
./configure \
--prefix="${SRC}" \
--extra-cflags="-I${SRC}/include" \
--extra-ldflags="-L${SRC}/lib" \
--bindir="${SRC}/bin" \
--extra-libs=-ldl \
--enable-version3 \
--enable-libmp3lame \
--enable-pthreads \
--enable-libx264 \
--enable-libxvid \
--enable-gpl \
--enable-postproc \
--enable-nonfree \
--enable-avresample \
--enable-libfdk-aac \
--disable-debug \
--enable-small \
--enable-libtls \
--enable-libx265 \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libfreetype \
--enable-libass \
--enable-shared \
--enable-pic && \
make && \
make install && \
make distclean && \
hash -r && \
cd /tmp && \
rm -rf ${DIR} && \
apk del .build-deps && \
apk del .runtime-deps && \
rm -rf /var/cache/apk/*


ENV OPENCV_VERSION=4.7.0
ENV BUILD="ca-certificates \
git \
build-base \
Expand Down