Skip to content
This repository was archived by the owner on Apr 14, 2020. It is now read-only.

Commit f659d0d

Browse files
enricomarchesinUllaakut
authored andcommitted
using builder pattern and ubuntu-18.04 upgrade (#63)
1 parent 0b16a45 commit f659d0d

File tree

6 files changed

+15
-47
lines changed

6 files changed

+15
-47
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ before_install:
99
- echo "Docker Hub credentials are working"
1010

1111
script:
12-
- ./build.sh
12+
- docker build -t rtspatt .
1313

1414
after_success:
1515
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
FROM ubuntu:17.10
1+
FROM ubuntu:18.04 as builder
22

33
4+
RUN apt-get update && apt-get install --no-install-recommends -y \
5+
build-essential \
6+
libgstrtspserver-1.0-dev \
7+
cmake
8+
9+
COPY . /rtspatt-src
10+
WORKDIR /rtspatt-build
11+
RUN cmake ../rtspatt-src && make
12+
13+
14+
FROM ubuntu:18.04
415

516
RUN apt-get update && apt-get install --no-install-recommends -y \
617
libgstrtspserver-1.0-dev \
@@ -14,7 +25,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
1425
apt-get clean &&\
1526
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1627

17-
COPY rtspatt /
28+
COPY --from=builder /rtspatt-build/rtspatt /rtspatt
1829
EXPOSE 8554
1930

2031
ENTRYPOINT ["/rtspatt"]

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ All of these environment variables and command line arguments override the defau
138138

139139
## Build
140140

141-
You can modify RTSPATT and create your own docker image. For this simply run:
142-
`./build.sh`
143-
144-
This script will use a docker image that has all the necessary dependencies to build the solution, and will output the binary once it's ready. It will also use this to build the RTSPATT docker image itself.
141+
You can modify RTSPATT and create your own docker image. We use the [`builder` pattern](https://blog.alexellis.io/mutli-stage-docker-builds/), so you can just modify the sources and run `docker build -t rstpatt .` to re-compile the sources and rebuild the image.
145142

146143
Once it's done, you can launch RTSPATT with:
147144
`docker run --rm -p 8554:8554 rtspatt` or `./rtspatt`.

build.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

build_image/Dockerfile-build

Lines changed: 0 additions & 14 deletions
This file was deleted.

build_image/build_rtspatt_inside_docker.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)