docker-playground/osmocom-bb-host-master/Dockerfile

54 lines
1.5 KiB
Docker
Raw Normal View History

ARG USER
ARG DISTRO
ARG OSMOCOM_REPO_MIRROR="http://download.opensuse.org"
FROM $USER/$DISTRO-build
# Arguments used after FROM must be specified again
ARG DISTRO
ARG OSMOCOM_REPO_TESTSUITE_MIRROR="http://download.opensuse.org"
2018-03-01 14:05:15 +00:00
MAINTAINER Harald Welte <laforge@gnumonks.org>
ARG OSMO_BB_BRANCH="master"
2018-03-01 14:05:15 +00:00
ARG OSMOCOM_REPO="$OSMOCOM_REPO_TESTSUITE_MIRROR/repositories/network:/osmocom:/nightly/Debian_9.0/"
2018-03-01 14:05:15 +00:00
COPY .common/Release.key /tmp/Release.key
2018-03-01 14:05:15 +00:00
RUN apt-key add /tmp/Release.key && \
rm /tmp/Release.key && \
echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-nightly.list
# python-enum34 is a dependecy of fake_trx as long we're using python2
2018-03-01 14:05:15 +00:00
ADD $OSMOCOM_REPO/Release /tmp/Release
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libosmocore-dev python-enum34 && \
2018-03-01 14:05:15 +00:00
apt-get clean
WORKDIR /tmp
RUN git clone git://git.osmocom.org/osmocom-bb.git
ADD http://git.osmocom.org/osmocom-bb/patch?h=$OSMO_BB_BRANCH /tmp/commit
RUN cd osmocom-bb && \
Fix git checkout for branches and commits Replace 'git checkout -f -B $BRANCH origin/$BRANCH && \' in all Dockerfiles that accept branch variables ($OSMO_TTCN3_BRANCH, $OSMO_MGW_BRANCH, ...) with the following: git checkout $BRANCH && \ (git symbolic-ref -q HEAD && git reset --hard origin/$BRANCH || exit 1); \ This allows using branch names and commit hashes in the $BRANCH variables. Using commits is needed for the bisect script added in [1]. The second line ("(git symbolic...") checks if we are in detached HEAD state after the checkout, and if we are not, pulls in all new commits from origin/$BRANCH. Note that it ends in ';' instead of '&&', because the command in the next line should be executed even if "git symbolic-ref" does not exit with 0 (detached HEAD state). Here is an example, to illustrate that the new command does the right thing. Clone a repository and be 50 commits behind origin/master: $ git clone "https://git.osmocom.org/osmo-mgw" $ cd osmo-mgw $ git reset --hard origin/master~50 With BRANCH="master": $ git checkout master && \ (git symbolic-ref -q HEAD && git reset --hard origin/master || exit 1); \ echo "done" Already on 'master' ... done $ git status Your branch is up-to-date with 'origin/master'. With BRANCH="85978d": $ git checkout 85978d && \ (git symbolic-ref -q HEAD && git reset --hard origin/85978d || exit 1); \ echo "done" Note: checking out '85978d'. ... done $ git status HEAD detached at 85978dad Related previous changes: * [2] made it work for commit hashes, but broke using branch names other than master, and pulling in new commits from master * [3] made branches other than master work again, but did not fix pulling in new commits from master * [4] reverted [3] and the git checkout related part from [2] [1] Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f [2] Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 [3] Change-Id: I2ff745c8d19b777d876170d5717c082ceb68a1f3 [4] Change-Id: Ie6da0f9ea96f11407e38545a6b3cf22ef9cadc25 Related: OS#4015 Change-Id: I4004980baf0b7d6096702b6f3067ccbdb369a28c
2019-05-22 07:08:25 +00:00
git fetch && git checkout $OSMO_BB_BRANCH && \
(git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_BB_BRANCH || exit 1); \
git rev-parse --abbrev-ref HEAD && git rev-parse HEAD
2018-03-01 14:05:15 +00:00
RUN cd osmocom-bb/src/host/trxcon && \
autoreconf -fi && \
./configure && \
make "-j$(nproc)" install
2018-03-01 14:05:15 +00:00
RUN cd osmocom-bb/src/host/virt_phy && \
autoreconf -fi && \
./configure && \
make "-j$(nproc)" install
2018-03-01 14:05:15 +00:00
RUN mkdir -p /data/unix
VOLUME /data
WORKDIR /data
#CMD ["/usr/local/sbin/virtphy","-s","/data/osmocom_l2"]