Dockerfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. # We need tar >= 1.35
  15. ARG TAR_VERSION="1.35"
  16. # Setup environment
  17. ENV DEBIAN_FRONTEND=noninteractive
  18. # This repository can be a bit slow at times. Don't panic...
  19. COPY apt-sources.list /etc/apt/sources.list
  20. # Install 32bit variant on x86_64 image.
  21. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
  22. dpkg --add-architecture i386; \
  23. fi
  24. # The container has no package lists, so need to update first
  25. RUN apt-get -o APT::Retries=3 update -y
  26. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
  27. apt-get -o APT::Retries=3 install -y --no-install-recommends \
  28. g++-multilib \
  29. libc6:i386; \
  30. fi
  31. RUN apt-get -o APT::Retries=3 install -y --no-install-recommends \
  32. bc \
  33. build-essential \
  34. bzr \
  35. ca-certificates \
  36. cmake \
  37. cpio \
  38. curl \
  39. cvs \
  40. file \
  41. flake8 \
  42. g++ \
  43. git \
  44. libncurses5-dev \
  45. locales \
  46. mercurial \
  47. openssh-server \
  48. python3 \
  49. python3-flake8 \
  50. python3-magic \
  51. python3-nose2 \
  52. python3-pexpect \
  53. python3-pytest \
  54. qemu-system-arm \
  55. qemu-system-misc \
  56. qemu-system-x86 \
  57. rsync \
  58. shellcheck \
  59. subversion \
  60. unzip \
  61. wget \
  62. && \
  63. apt-get -y autoremove && \
  64. apt-get -y clean
  65. # Build host-tar
  66. RUN curl -sfL https://ftpmirror.gnu.org/tar/tar-${TAR_VERSION}.tar.xz | \
  67. tar -Jx -C /tmp && \
  68. cd /tmp/tar-${TAR_VERSION} && \
  69. FORCE_UNSAFE_CONFIGURE=1 ./configure \
  70. --disable-year2028 && \
  71. make && \
  72. make install && \
  73. rm -rf /tmp/tar-${TAR_VERSION}
  74. # To be able to generate a toolchain with locales, enable one UTF-8 locale
  75. RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen && \
  76. /usr/sbin/locale-gen
  77. RUN useradd -ms /bin/bash br-user && \
  78. chown -R br-user:br-user /home/br-user
  79. USER br-user
  80. WORKDIR /home/br-user
  81. ENV HOME=/home/br-user
  82. ENV LC_ALL=en_US.UTF-8