mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +00:00
tools/alpine: Add iucode_tool to base
The iucode_tool is used to convert the Intel CPU microcode binaries into a cpio archive. There is no alpine package for it, so compile it from source. This is for x86_64 only and on other archs we create a empty file. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
db5c8a7da8
commit
31cb9539b8
@ -53,6 +53,26 @@ RUN apk add --no-cache btrfs-progs-dev gcc libc-dev linux-headers make
|
|||||||
RUN cd $GOPATH/src/github.com/containerd/containerd && \
|
RUN cd $GOPATH/src/github.com/containerd/containerd && \
|
||||||
make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' BUILD_TAGS="static_build"
|
make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' BUILD_TAGS="static_build"
|
||||||
|
|
||||||
|
# Checkout and compile iucode-tool for Intel CPU microcode
|
||||||
|
# On non-x86_64 create a dummy file to copy below.
|
||||||
|
ENV IUCODE_REPO=https://gitlab.com/iucode-tool/iucode-tool
|
||||||
|
ENV IUCODE_COMMIT=v2.2
|
||||||
|
WORKDIR /
|
||||||
|
ADD iucode-tool.patch /
|
||||||
|
RUN set -e && \
|
||||||
|
mkdir /iucode_tool && \
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then \
|
||||||
|
apk add --no-cache automake autoconf argp-standalone git gcc make musl-dev patch && \
|
||||||
|
git clone ${IUCODE_REPO} && \
|
||||||
|
cd /iucode-tool && \
|
||||||
|
git checkout ${IUCODE_COMMIT} && \
|
||||||
|
patch -p 1 < /iucode-tool.patch && \
|
||||||
|
./autogen.sh && \
|
||||||
|
./configure && \
|
||||||
|
make && \
|
||||||
|
cp iucode_tool /iucode_tool; \
|
||||||
|
fi
|
||||||
|
|
||||||
FROM alpine:3.7
|
FROM alpine:3.7
|
||||||
|
|
||||||
COPY --from=mirror /etc/apk/repositories /etc/apk/repositories
|
COPY --from=mirror /etc/apk/repositories /etc/apk/repositories
|
||||||
@ -62,6 +82,7 @@ COPY --from=mirror /mirror /mirror/
|
|||||||
COPY --from=mirror /go/bin /go/bin/
|
COPY --from=mirror /go/bin /go/bin/
|
||||||
COPY --from=mirror /Dockerfile /Dockerfile
|
COPY --from=mirror /Dockerfile /Dockerfile
|
||||||
COPY --from=mirror /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd/
|
COPY --from=mirror /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd/
|
||||||
|
COPY --from=mirror /iucode_tool /usr/bin/
|
||||||
|
|
||||||
RUN apk update && apk upgrade -a
|
RUN apk update && apk upgrade -a
|
||||||
|
|
||||||
|
12
tools/alpine/iucode-tool.patch
Normal file
12
tools/alpine/iucode-tool.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/iucode_tool.c b/iucode_tool.c
|
||||||
|
index 460087c..8825ed6 100644
|
||||||
|
--- a/iucode_tool.c
|
||||||
|
+++ b/iucode_tool.c
|
||||||
|
@@ -31,6 +31,7 @@
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <cpuid.h>
|
||||||
|
+#include <limits.h>
|
||||||
|
|
||||||
|
#include "intel_microcode.h"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user