Skip to content

Commit

Permalink
PMM-13487 Create cache directories at image build time
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Nov 29, 2024
1 parent b26f4cc commit 44bc7fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build/docker/rpmbuild/Dockerfile.el9
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN yum install -y gcc gcc-c++ \
# keep that format for easier search
ARG GO_VERSION
ENV GO_VERSION=${GO_VERSION:-1.23.2}
ENV GO_RELEASER_VERSION=2.4.1
ENV GO_RELEASER_VERSION=2.4.8
ENV NODE_OPTIONS=--max_old_space_size=8000

RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \
Expand All @@ -42,7 +42,7 @@ RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \
rm /tmp/golang.tar.gz /tmp/goreleaser.rpm && \
curl -o /usr/bin/yq -fSsL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH} && \
chmod +x /usr/bin/yq && \
yum clean all && rm -rf /var/cache/yum
yum clean all && rm -rf /var/cache/yum /var/cache/dnf


RUN update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0
Expand All @@ -54,11 +54,14 @@ RUN useradd builder -u 1000 -m -G users,wheel && \
echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \
echo "# macros" > /home/builder/.rpmmacros && \
echo "%_topdir /home/builder/rpm" >> /home/builder/.rpmmacros && \
mkdir -p /home/builder/rpm /home/builder/.cache/go-build /home/builder/go/pkg/mod && \
mkdir -p /home/builder/{rpm,go/pkg} /home/builder/.cache/{go-build,yarn,dnf,go/pkg/mod} && \
chmod 755 /home/builder && \
chown -R builder:builder /home/builder

USER builder

RUN ln -s /home/builder/.cache/go/pkg/mod /home/builder/go/pkg/mod && \
ln -s /home/builder/.cache/dnf /var/cache/dnf

ENV FLAVOR=rpmbuild OS=centos DIST=el9
WORKDIR /home/builder/rpm
1 change: 1 addition & 0 deletions build/local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ Currently, Local Builds target the following platforms and distributions:

- use the `--debug` parameter to control the verbosity of the logs
- implement the `--release` parameter
- remove `jq` from prerequisites
1 change: 1 addition & 0 deletions build/packages/rpm/server/SPECS/grafana.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export GOPATH="$(pwd)/_build"

make build-go

export NO_COLOR=1
make deps-js
make build-js

Expand Down

0 comments on commit 44bc7fb

Please sign in to comment.