Docker tag alpine:edge selects alpine v3.7 on Raspberry Pi 3 B+
I develop a small c application and wanted to use the alpine edge image to get a more recent c compiler enabling usage of features from c++17 and following.
Selecting alpine:edge in the Dockerfile pulled alpine v3.7, selecting alpine:3.8 pulled alpine v3.8.
I am running centos 7 on the pi right now and writing my first Dockerfile, I hope I didn’t miss anything :)
uname -a
Linux pi3 4.14.82-v7.1.el7 #1 SMP Sun Nov 25 22:42:27 UTC 2018 armv7l armv7l armv7l GNU/Linux
Dockerfile
FROM alpine:edge
LABEL maintainer="Konstantin Bläsi <kblaesi@gmail.com>"
ENV YASDI_VERSION 1.8.1
ENV YASDI_SRC /usr/src/yasdi
ENV LOGGER_SRC /usr/src/sma-yasdi-logger
# install build dependencies
RUN apk update && apk add --no-cache binutils cmake ca-certificates make linux-headers musl-dev gcc g++ curl
# build and install yasdi
# RUN curl -sSLo /usr/src/libc_musl.patch https://raw.githubusercontent.com/konstantinblaesi/sma-yasdi-logger/master/docker/libc_musl.patch
COPY ./libc_musl.patch /usr/src/
WORKDIR /usr/src
RUN curl -sSLo v$YASDI_VERSION.tar.gz https://github.com/konstantinblaesi/yasdi/archive/v$YASDI_VERSION.tar.gz
RUN mkdir $YASDI_SRC && tar -xf v$YASDI_VERSION.tar.gz -C $YASDI_SRC --strip 1 && rm -f v$YASDI_VERSION.tar.gz
WORKDIR $YASDI_SRC
RUN patch -p1 < /usr/src/libc_musl.patch
RUN mkdir $YASDI_SRC/projects/generic-cmake/build
WORKDIR $YASDI_SRC/projects/generic-cmake/build
RUN cmake -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_C_FLAGS="-DLIBC_MUSL -O3" ..
RUN make -j$(getconf _NPROCESSORS_ONLN) && make install
# build and install logger
RUN curl -sSLo logger.tar.gz https://github.com/konstantinblaesi/sma-yasdi-logger/archive/master.tar.gz
RUN mkdir $LOGGER_SRC && tar -xf logger.tar.gz -C $LOGGER_SRC --strip 1 && rm -f logger.tar.gz
RUN mkdir $LOGGER_SRC/build
WORKDIR $LOGGER_SRC/build
RUN cmake -D CMAKE_INSTALL_PREFIX=/usr .. \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& rm -rf $YASDI_SRC \
&& rm -rf $LOGGER_SRC
# uninstall build dependencies
RUN apk del binutils cmake make linux-headers musl-dev gcc g++ curl
RUN apk add libgcc libstdc++
CMD ["sma_logger", "/etc/sma_logger/sma.ini", "3"]
Partial build log
# docker build --no-cache -t logger .
Sending build context to Docker daemon 4.608 kB
Step 1/23 : FROM alpine:edge
---> 11498243e5a8
Step 2/23 : LABEL maintainer "Konstantin Bläsi <kblaesi@gmail.com>"
---> Running in 94b87b7ebeac
---> 46372141ccf9
Removing intermediate container 94b87b7ebeac
Step 3/23 : ENV YASDI_VERSION 1.8.1
---> Running in 16e8017f9c7a
---> 51d94970124d
Removing intermediate container 16e8017f9c7a
Step 4/23 : ENV YASDI_SRC /usr/src/yasdi
---> Running in 89eecaad054e
---> 6342c67ff715
Removing intermediate container 89eecaad054e
Step 5/23 : ENV LOGGER_SRC /usr/src/sma-yasdi-logger
---> Running in c623141637c5
---> 19f27afab56e
Removing intermediate container c623141637c5
Step 6/23 : RUN apk update && apk add --no-cache binutils cmake make linux-headers musl-dev gcc g++ curl
---> Running in e281718ed0a8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/armhf/APKINDEX.tar.gz
v3.7.1-79-g2b8672c573 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.1-77-g6121be436a [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 8885 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/armhf/APKINDEX.tar.gz
(from redmine: issue id 9873, created on 2019-01-19)