-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for ARM 32/64 #49
Changes from 21 commits
226403d
2aa2c0a
49bb254
3c32698
3f986df
1e3965c
3e58734
3b294e2
f0c61c4
a85d6bf
3cc8dd5
11c8835
ec5097b
794aa04
ff9a575
8fdd209
c21e5b6
fa0c26d
d645788
93e3fed
8f0a16a
46e965a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
ARG BASE_IMAGE=amazonlinux:2.0.20181114 | ||
FROM ${BASE_IMAGE} | ||
|
||
# Build Args | ||
ARG GIMME_GO_VERSION=1.13.8 | ||
ARG DD_PIP_VERSION=19.1 | ||
ARG DD_SETUPTOOLS_VERSION=41.0.1 | ||
ARG CMAKE_VERSION=3.14.4 | ||
ARG CLANG_VERSION=8.0.0 | ||
ARG DD_TARGET_ARCH=arm64v8 | ||
|
||
# Environment | ||
ENV GOPATH /go | ||
ENV GIMME_GO_VERSION $GIMME_GO_VERSION | ||
ENV DD_PIP_VERSION $DD_PIP_VERSION | ||
ENV DD_SETUPTOOLS_VERSION $DD_SETUPTOOLS_VERSION | ||
ENV CMAKE_VERSION $CMAKE_VERSION | ||
ENV CLANG_VERSION $CLANG_VERSION | ||
ENV DD_TARGET_ARCH $DD_TARGET_ARCH | ||
|
||
RUN yum groupinstall -y development && yum -y install which perl-ExtUtils-MakeMaker ncurses-compat-libs git procps \ | ||
curl-devel expat-devel gettext-devel openssl-devel systemd-devel zlib-devel bzip2 glibc-static python-devel tar pkgconfig \ | ||
libtool autoconf policycoreutils-python | ||
|
||
# RVM | ||
COPY ./rvm/gpg-keys /gpg-keys | ||
RUN gpg --import /gpg-keys/* | ||
RUN rm -rf /gpg-keys | ||
RUN curl -sSL https://get.rvm.io | bash -s stable | ||
RUN /bin/bash -l -c "rvm requirements" | ||
RUN /bin/bash -l -c "rvm install 2.3 && rvm cleanup all" | ||
RUN /bin/bash -l -c "gem install bundler --no-document" | ||
|
||
# Pip & Invoke | ||
RUN curl "https://bootstrap.pypa.io/get-pip.py" | python2.7 - pip==${DD_PIP_VERSION} setuptools==${DD_SETUPTOOLS_VERSION} | ||
RUN pip install invoke distro==1.4.0 awscli==1.16.240 | ||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we use Python 3 here? Base image doesn't have it so it needs to be installed. Not a blocker but it would useful if we ever need a Python 3 only package. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I think we could have python 3 in this image, but I think this should be addressed as a separate PR |
||
|
||
# Gimme | ||
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | ||
RUN chmod +x /bin/gimme | ||
RUN gimme $GIMME_GO_VERSION | ||
COPY ./gobin.sh /etc/profile.d/ | ||
|
||
# CMake. Pre-built using the build-cmake.sh script, to speed-up docker build. | ||
RUN curl -sL -O https://dd-agent-omnibus.s3.amazonaws.com/cmake-${CMAKE_VERSION}-amzn-aarch64.tar.xz && \ | ||
tar xf cmake-${CMAKE_VERSION}-amzn-aarch64.tar.xz --no-same-owner -kC / && \ | ||
rm cmake-${CMAKE_VERSION}-amzn-aarch64.tar.xz | ||
ENV PATH="/opt/cmake/bin:$PATH" | ||
|
||
# Install clang and llvm version 8. Pre-built because building takes ~4 hours. | ||
# This was built from sources on centos 7, using the build-clang.sh script | ||
RUN curl -sL -o clang_llvm.tar.xz https://dd-agent-omnibus.s3.amazonaws.com/clang%2Bllvm-${CLANG_VERSION}-aarch64-linux.tar.xz && \ | ||
tar xf clang_llvm.tar.xz --no-same-owner -kC / && \ | ||
rm clang_llvm.tar.xz | ||
ENV PATH="/opt/clang/bin:$PATH" | ||
|
||
# Entrypoint | ||
COPY ./entrypoint.sh / | ||
RUN chmod +x /entrypoint.sh | ||
|
||
# create the agent build folder within $GOPATH | ||
RUN mkdir -p /go/src/github.com/DataDog/datadog-agent | ||
|
||
# Force umask to 0022 | ||
RUN echo "umask 0022" >> /root/.bashrc | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change the base image? (just for future reference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially it was
amazonlinux
, see #21. Amazon Linux however, doesn't provide 32 bit versions of their image, so we switched to CentOS 7 (which is what Amazon Linux is supposed to be based on I think). However, CentOS 7 is quite old and ships with GCC 4.8.5 - which causes issues when trying to buildrtloader
.Hence we had two options:
We chose the latter because we don't build
rtloader
for 32 bit ARM, so it's simpler to revert to the 'known to work' image.