mirror of
https://github.com/axiomatic-systems/Bento4.git
synced 2026-01-12 00:18:59 +08:00
add dev Docker file
This commit is contained in:
23
Build/Docker/Dockerfile.dev
Normal file
23
Build/Docker/Dockerfile.dev
Normal file
@@ -0,0 +1,23 @@
|
||||
# Docker file used to create an environment with which to build a release
|
||||
|
||||
FROM ubuntu:bionic
|
||||
|
||||
# Install Dependencies
|
||||
# Upgrade any ubuntu packages
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
python3 \
|
||||
git
|
||||
|
||||
# Add a user
|
||||
ARG USER=bento4
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
RUN useradd -m ${USER} --uid=${UID}
|
||||
|
||||
# Run as the user we have setup
|
||||
USER ${UID}:${GID}
|
||||
WORKDIR /home/${USER}
|
||||
|
||||
CMD ["bash"]
|
||||
@@ -122,14 +122,6 @@ else:
|
||||
script_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
BENTO4_HOME = os.path.join(script_dir,'..')
|
||||
|
||||
CMAKE_BUILD = False
|
||||
if len(sys.argv) > 3:
|
||||
if sys.argv[3] == 'cmake':
|
||||
CMAKE_BUILD = True
|
||||
else:
|
||||
print('ERROR: unknown build type')
|
||||
sys.exit(1)
|
||||
|
||||
# ensure that BENTO4_HOME has been set and exists
|
||||
if not os.path.exists(BENTO4_HOME) :
|
||||
print('ERROR: BENTO4_HOME ('+BENTO4_HOME+') does not exist')
|
||||
@@ -158,7 +150,7 @@ if SDK_TARGET is None:
|
||||
'linux-i386' : 'x86-unknown-linux',
|
||||
'linux-x86_64': 'x86_64-unknown-linux',
|
||||
'linux2' : 'x86-unknown-linux',
|
||||
'win32' : 'x86-microsoft-win32-vs2010',
|
||||
'win32' : 'x86_64-microsoft-win32',
|
||||
'darwin' : 'universal-apple-macosx'
|
||||
}
|
||||
|
||||
@@ -182,14 +174,7 @@ SDK_ROOT=SDK_BUILD_ROOT+'/'+SDK_NAME
|
||||
SDK_TARGET_DIR='Build/Targets/'+SDK_TARGET
|
||||
SDK_TARGET_ROOT=BENTO4_HOME+'/'+SDK_TARGET_DIR
|
||||
|
||||
if CMAKE_BUILD:
|
||||
SDK_BUILD_OUTPUT_DIR = 'cmakebuild'
|
||||
else:
|
||||
# special case for Xcode builds
|
||||
if SDK_TARGET == 'universal-apple-macosx':
|
||||
SDK_BUILD_OUTPUT_DIR='Build/Targets/universal-apple-macosx/Build/Products/Release'
|
||||
else:
|
||||
SDK_BUILD_OUTPUT_DIR = SDK_TARGET_DIR + '/Release'
|
||||
SDK_BUILD_OUTPUT_DIR = 'cmakebuild'
|
||||
|
||||
print(SDK_NAME)
|
||||
|
||||
|
||||
@@ -37,3 +37,13 @@ def get_sdk_revision():
|
||||
def build(ctx):
|
||||
command = "docker image build -t bento4:{version}-{revision} -t bento4:latest --build-arg BENTO4_VERSION={version}-{revision} -f Build/Docker/Dockerfile .".format(version=get_version(), revision=get_sdk_revision())
|
||||
ctx.run(command)
|
||||
|
||||
@task
|
||||
def build_for_dev(ctx):
|
||||
command = "docker image build -t bento4-dev:latest -f Build/Docker/Dockerfile.dev ."
|
||||
ctx.run(command)
|
||||
|
||||
@task
|
||||
def shell(ctx):
|
||||
command = "docker run --rm -it -v `pwd`:/home/bento4/project -w /home/bento4/project bento4-dev bash"
|
||||
ctx.run(command, pty=True)
|
||||
|
||||
Reference in New Issue
Block a user