f56882f9cfc1ada57fdf282385205316a5eaf2ce
[it/dev.git] / bldr-imgs / bldr-alpine3-mdclog / Dockerfile
1 # O-RAN-SC
2 #
3 # Copyright (C) 2019-2020 AT&T Intellectual Property and Nokia
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 # Provides MDCLOG for Alpine including header files and shared-object libraries,
18 # basically a workaround for missing APK support at PackageCloud.io.
19 # Unlike other bldr- images, this only has library files, no build tools.
20 # See list of available files below.  Use the following command to copy a file
21 # in a Docker build, after replacing "TAG" with the desired version string:
22 #
23 # COPY --from=nexus3.o-ran-sc.org:10002/bldr-alpine3-mdclog:TAG /usr/local/lib/libmdclog.so /usr/local/lib/libmdclog.so
24 #
25 # /usr/local/include/mdclog:
26 #     mdclog.h
27 #
28 # /usr/local/lib:
29 #     libmdclog.a
30 #     libmdclog.la
31 #     libmdclog.so
32 #     libmdclog.so.0         (subject to version change)
33 #     libmdclog.so.0.0.4     (ditto)
34
35 FROM alpine:3.11 as bldr
36 RUN apk update && apk add autoconf automake build-base cmake libtool pkgconfig git sudo
37
38 # the autoconf-archive in alpine's edge repos is too new
39 # for our purposes, so we'll use one from the source.
40 RUN cd /tmp \
41     && git clone --branch v2015.09.25 git://git.sv.gnu.org/autoconf-archive.git \
42     && cp /tmp/autoconf-archive/m4/* /usr/share/aclocal \
43     && rm -rf /tmp/autoconf-archive
44
45 # MCDLOG, version is pinned
46 RUN cd /tmp \
47    && git clone --branch v0.0.4 https://gerrit.o-ran-sc.org/r/com/log \
48    && cd log \
49    && ./autogen.sh \
50    && ./configure \
51    && make \
52    && make install
53
54 FROM scratch
55 COPY --from=bldr /usr/local/include/mdclog /usr/local/include/mdclog
56 COPY --from=bldr /usr/local/lib/libmdclog.* /usr/local/lib/