-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.linux-image.build
88 lines (73 loc) · 3.29 KB
/
Dockerfile.linux-image.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Dockerfile.linux-image.build
#------------------------------------------------------------------------------------------
# Dockerfile to create a Linux Ubuntu Image for Testing from you current local branch.
# You can use this to create a local image then run it.
# --- This is for Development and Testing Purposes Only. ---
#
# - Usage: In Visual Studio Code when Docker Extensions are Installed
# - you can right click this file and select build. Or From the command Line:
# $ docker build --pull --rm -f "Dockerfile.linux-image.build" -t oblivion2xrm:latest "."
# - To start-up the image you can use "docker-compose up" OR run the following command:
# $ docker run -t -dit oblivion2xrm
#------------------------------------------------------------------------------------------
# Get the Latest base Ubuntu image from Docker Hub
FROM ubuntu:latest
# Update apps on the base image
RUN apt-get update && apt-get install --no-install-recommends --yes \
# ----------------------
# Install Dependencies
# ----------------------
# Debugging, good to have a local editor, and git for changes
nano \
git \
# Build Essentials for the Compiler
software-properties-common ca-certificates wget curl ssh \
build-essential \
# Build Application Dependencies
libyaml-cpp-dev \
libssh-dev \
# Boost only needed for Propmt and Menu Converters, not needed for preview.
# libboost-all-dev \
libsqlite3-dev \
uuid-dev \
libunittest++-dev \
# Terminal Setup - Encodings and Locales needed
locales-all \
&& apt-get -y autoclean
# Setup Enviroment Variables for locales
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Copy the current folder base project to the Docker Container.
COPY . /usr/src/Oblivion2-XRM
# Specify the working directory on the Container
WORKDIR /usr/src/Oblivion2-XRM/linux
RUN mkdir -p ./Release
# ----------------------
# Build The System
# ----------------------
# Build the SQLite Wrapper Dependency
RUN make -f SqliteWrapped.mk
# SQLITE Wrapped - Setup Compiled Header File for other Modules to use.
RUN cat ../sqlitewrap/IError.h ../sqlitewrap/StderrLog.h ../sqlitewrap/SysLogs.h ../sqlitewrap/Database.h ../sqlitewrap/Query.h > ./Release/libSqliteWrapped.h
# Build the Main XRM Server And Helper Apps Along with Unit Tests
# Comment Out the Prompt Converters, Not really needed for a Preview, but can toggle this if desired.
#RUN make -f xrm-menu-convert.mk
#RUN make -f xrm-menu-prompt-convert.mk
RUN make -f xrm-server.mk
#RUN make -f xrm-unittest.mk
# Switch to the Debug Directory, and copy executables to the Build folder.
WORKDIR /usr/src/Oblivion2-XRM/linux/Release
# Comment Out the Prompt Converters, Not really needed for a Preview, but can toggle this if desired.
#RUN cp ./xrm-menu-convert ../../build
#RUN cp ./xrm-menu-prompt-convert ../../build
#RUN cp ./xrm-unittest ../../build
RUN cp ./xrm-server ../../build
# Update permissions to avoid any issues, this runs as root, so should revisit this
# However, this is a development image/build so not for prodution use.
WORKDIR /usr/src/Oblivion2-XRM
RUN chmod 077 * -R
# -------------------------------------------------------------------------------
# Startup the BBS when the container starts
# -------------------------------------------------------------------------------
WORKDIR /usr/src/Oblivion2-XRM/build
ENTRYPOINT ["./xrm-server"]