# How to build kibana RPM from source code using only preinstalled local tools

**URL:** <https://discuss.elastic.co/t/how-to-build-kibana-rpm-from-source-code-using-only-preinstalled-local-tools/270825>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [April 21, 2021, 10:19am UTC](https://discuss.elastic.co/t/how-to-build-kibana-rpm-from-source-code-using-only-preinstalled-local-tools/270825 "2021-04-21T10:19:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![europ](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@europ](https://discuss.elastic.co/u/europ)\
**Post date:** [April 21, 2021, 10:19am UTC](https://discuss.elastic.co/t/how-to-build-kibana-rpm-from-source-code-using-only-preinstalled-local-tools/270825/1 "2021-04-21T10:19:51Z")

</div>

#### Questions

1. How can I build Kibana RPM (only RPM, nothing else is required) using **only** local tools (build dependencies) that are preinstalled?
  - I want to use `--skip-node-download` or `--prefer-offline` (assume that you have all the necessary build tools preinstalled locally, so there is no need to have an internet connection to download further tools)
  - [Issue in building Kibana rpm 7.0.1 from src](https://discuss.elastic.co/t/issue-in-building-kibana-rpm-7-0-1-from-src/224606)

2. Is it possible to build this particular RPM from step 1.) without any direct in-code intervention(s)?
  - an elastic discussion noted that there is a need to disable the SHA SUM verification (`getNodeShasums`)

#### Related

- [Set Up Kibana | Kibana Guide [7.6] | Elastic](https://www.elastic.co/guide/en/kibana/7.6/setup.html#supported-platforms)
- [Building a Kibana distributable | Kibana Guide [7.16] | Elastic](https://www.elastic.co/guide/en/kibana/7.x/building-kibana.html#_building_os_packages)
- [Issue in building Kibana rpm 7.0.1 from src](https://discuss.elastic.co/t/issue-in-building-kibana-rpm-7-0-1-from-src/224606)
- [Using local node js to run Kibana](https://discuss.elastic.co/t/using-local-node-js-to-run-kibana/158187)

#### Environment

- Kibana: [7.6.2](https://github.com/elastic/kibana/releases/tag/v7.6.2)
- Docker Image: [oraclelinux:8](https://hub.docker.com/_/oraclelinux)
- Yum Repository: [yum.oracle.com](http://yum.oracle.com/)
- NodeJS: 10.19.0
- NPM: 6.13.4
- Yarn: 1.22.10

#### Dockerfile (works, but not as expected)

```auto
FROM oraclelinux:8

WORKDIR /tmp

# install dependencies
RUN dnf group install -y "Development Tools" && dnf install -y ruby-devel && gem install fpm -v 1.5.0
RUN curl -O https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/npm-6.13.4-1.10.19.0.1.module+el8.1.0+5552+3cab52c0.x86_64.rpm
RUN curl -O https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/nodejs-10.19.0-1.module+el8.1.0+5552+3cab52c0.x86_64.rpm
RUN rpm -i npm-6.13.4*.rpm nodejs-10.19.0*.rpm
RUN npm install --global yarn

# USER/GROUP variables
ARG USERID=1000
ARG USERNAME=kibana
ARG GROUPID=1000
ARG USERGROUP=$USERNAME

# create user
RUN groupadd $USERGROUP -g $GROUPID
RUN useradd $USERNAME -u $USERID -g $GROUPID -m -s /bin/bash

USER $USERNAME

# add source code
COPY --chown=$USERID:$GROUPID . /kibana
RUN chmod -R g=u /kibana
RUN find /kibana -type d -exec chmod g+s {} \;

WORKDIR /kibana

# WORKAROUND, see https://github.com/elastic/kibana/issues/46880#issuecomment-729857833
RUN chmod +x /kibana/bin/kibana*

# FIXME
# install kibana dependencies
RUN yarn kbn bootstrap
# RUN yarn kbn bootstrap --prefer-offline

# FIXME
# build kibana
RUN yarn build --rpm
# RUN yarn build --oss --rpm --skip-node-download --skip-archives

```

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [April 23, 2021, 11:31am UTC](https://discuss.elastic.co/t/how-to-build-kibana-rpm-from-source-code-using-only-preinstalled-local-tools/270825/2 "2021-04-23T11:31:30Z")

</div>

This is something we really tried before and configured for. With the change to Bazel i think it could be doable once you have the cache in place after bootstrapping once.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 21, 2021, 11:32am UTC](https://discuss.elastic.co/t/how-to-build-kibana-rpm-from-source-code-using-only-preinstalled-local-tools/270825/3 "2021-05-21T11:32:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
