mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-25 22:55:55 -05:00
Initial docker support (#55)
* Dockerfile which allows full build on ubuntu * No cross-compile yet * Fixed build scripts bug found with docker Signed-off-by: Dolf Starreveld <dolf@starreveld.com>
This commit is contained in:
parent
58152e8d94
commit
eaae640703
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
ui-dist
|
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
MAINTAINER Dolf Starreveld "dolf@starreveld.com"
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y apt-utils && \
|
||||||
|
apt-get install -y apt-transport-https tzdata git curl sudo vim && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
RUN groupadd -r moonfire-nvr && \
|
||||||
|
useradd moonfire-nvr --no-log-init -m -r -g moonfire-nvr && \
|
||||||
|
echo 'moonfire-nvr ALL=(ALL) NOPASSWD: ALL' >>/etc/sudoers
|
||||||
|
ENV HOME /home/moonfire-nvr
|
||||||
|
COPY --chown=moonfire-nvr:moonfire-nvr . /home/moonfire-nvr/moonfire-nvr
|
||||||
|
USER moonfire-nvr
|
||||||
|
WORKDIR /home/moonfire-nvr/moonfire-nvr
|
||||||
|
RUN whoami && ls -l && \
|
||||||
|
./scripts/setup-ubuntu.sh && \
|
||||||
|
./scripts/setup-ubuntu.sh && \
|
||||||
|
./scripts/build.sh -B
|
||||||
|
|
||||||
|
CMD [ "/bin/bash" ]
|
@ -82,7 +82,7 @@ catPrefix()
|
|||||||
|
|
||||||
mkdir_moonfire()
|
mkdir_moonfire()
|
||||||
{
|
{
|
||||||
sudo -u ${NVR_USER} -H mkdir "$@"
|
sudo -u "${NVR_USER}" -H mkdir "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_multi()
|
echo_multi()
|
||||||
@ -342,7 +342,8 @@ prep_moonfire_user()
|
|||||||
--ingroup "${NVR_GROUP}" --home "${NVR_HOME}"
|
--ingroup "${NVR_GROUP}" --home "${NVR_HOME}"
|
||||||
fi
|
fi
|
||||||
if [ ! -d "${NVR_HOME}" ]; then
|
if [ ! -d "${NVR_HOME}" ]; then
|
||||||
mkdir_moonfire "${NVR_HOME}"
|
sudo mkdir "${NVR_HOME}"
|
||||||
|
sudo chown "${NVR_USER}:${NVR_GROUP}" "${NVR_HOME}"
|
||||||
fi
|
fi
|
||||||
sudo chown ${NVR_USER}:${NVR_GROUP} "${NVR_HOME}"
|
sudo chown ${NVR_USER}:${NVR_GROUP} "${NVR_HOME}"
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
initEnvironmentVars
|
initEnvironmentVars
|
||||||
makePrepConfig
|
makePrepConfig
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
|
||||||
# Process command line options
|
# Process command line options
|
||||||
@ -119,9 +120,9 @@ if ! versionAtLeast "$ffv" "$FFMPEG_MIN_VERSION"; then
|
|||||||
echo_info -x "Fetching FFmpeg source..."
|
echo_info -x "Fetching FFmpeg source..."
|
||||||
git clone --depth 1 -b "release/${FFMPEG_RELEASE_VERSION}" https://github.com/FFmpeg/FFmpeg.git
|
git clone --depth 1 -b "release/${FFMPEG_RELEASE_VERSION}" https://github.com/FFmpeg/FFmpeg.git
|
||||||
cd FFmpeg
|
cd FFmpeg
|
||||||
pt=`uname -p 2>& /dev/null`
|
pt=`uname -p 2>/dev/null`
|
||||||
if [ -z "${pt##*86*}" ]; then
|
if [ -z "${pt##*86*}" ]; then
|
||||||
sudo apt-get install -y yasm
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y yasm
|
||||||
fi
|
fi
|
||||||
./configure --enable-shared
|
./configure --enable-shared
|
||||||
make
|
make
|
||||||
|
Loading…
Reference in New Issue
Block a user