Dockerfile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # This Dockerfile generates the docker image that gets used by Gitlab CI
  2. # To build it for arm64 and amd64 (YYYYMMDD.HHMM is the current date and time in UTC):
  3. # docker buildx create --use
  4. # docker buildx build --platform linux/amd64,linux/arm64/v8 \
  5. # -t registry.gitlab.com/buildroot.org/buildroot/base:YYYYMMDD.HHMM \
  6. # --push support/docker
  7. # We use a specific tag for the base image *and* the corresponding date
  8. # for the repository., so do not forget to update the apt-sources.list
  9. # file that is shipped next to this Dockerfile.
  10. FROM debian:bookworm-20250203
  11. LABEL maintainer="Buildroot mailing list <buildroot@buildroot.org>" \
  12. vendor="Buildroot" \
  13. description="Container with everything needed to run Buildroot"
  14. # Architecture to build for
  15. ARG TARGETPLATFORM
  16. # We need tar >= 1.35
  17. ARG TAR_VERSION="1.35"
  18. # Setup environment
  19. ENV DEBIAN_FRONTEND=noninteractive
  20. # This repository can be a bit slow at times. Don't panic...
  21. COPY apt-sources.list /etc/apt/sources.list
  22. # Install 32bit variant on x86_64 image.
  23. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
  24. dpkg --add-architecture i386; \
  25. fi
  26. # The container has no package lists, so need to update first
  27. RUN apt-get -o APT::Retries=3 update -y
  28. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
  29. apt-get -o APT::Retries=3 install -y --no-install-recommends \
  30. g++-multilib \
  31. libc6:i386; \
  32. fi
  33. RUN apt-get -o APT::Retries=3 install -y --no-install-recommends \
  34. bc \
  35. build-essential \
  36. bzr \
  37. ca-certificates \
  38. cmake \
  39. cpio \
  40. curl \
  41. cvs \
  42. file \
  43. flake8 \
  44. g++ \
  45. git \
  46. libncurses5-dev \
  47. locales \
  48. mercurial \
  49. openssh-server \
  50. python3 \
  51. python3-flake8 \
  52. python3-magic \
  53. python3-nose2 \
  54. python3-pexpect \
  55. python3-pytest \
  56. qemu-system-arm \
  57. qemu-system-misc \
  58. qemu-system-x86 \
  59. rsync \
  60. shellcheck \
  61. subversion \
  62. unzip \
  63. wget \
  64. && \
  65. apt-get -y autoremove && \
  66. apt-get -y clean
  67. # Build host-tar
  68. RUN curl -sfL https://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz | \
  69. tar -Jx -C /tmp && \
  70. cd /tmp/tar-${TAR_VERSION} && \
  71. FORCE_UNSAFE_CONFIGURE=1 ./configure \
  72. --disable-year2038 && \
  73. make && \
  74. make install && \
  75. rm -rf /tmp/tar-${TAR_VERSION}
  76. # To be able to generate a toolchain with locales, enable one UTF-8 locale
  77. RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen && \
  78. /usr/sbin/locale-gen
  79. RUN useradd -ms /bin/bash br-user && \
  80. chown -R br-user:br-user /home/br-user
  81. USER br-user
  82. WORKDIR /home/br-user
  83. ENV HOME=/home/br-user
  84. ENV LC_ALL=en_US.UTF-8