Skip to content

Commit

Permalink
Added support for rocky8 and centos7 in dockerfile (#245)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #245

Added support for rocky8 and centos7 in dockerfile

Reviewed By: bigzachattack

Differential Revision: D55795501

fbshipit-source-id: 677e6437fdfd2daaa9e6d1902a575bb632eaae6e
  • Loading branch information
Victor Henriquez authored and facebook-github-bot committed Dec 13, 2024
1 parent 7570766 commit a73b884
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ We include a `Dockerfile` in the repo to make release generation easy.
Run the following commands for building debian (Ubuntu based) and rpm (Rocky/CentOS based)packages
```
# For debian package
docker build . -f /path/to/dynolog_repo/dynolog.dockerfile -t dyno_build:ubuntu20.04 --target ubuntu_build_x86
docker build . -f /path/to/dynolog_repo/dynolog.dockerfile -t dyno_build:ubuntu20.04 --target ubuntu_x86
# For rpm package
docker build . -f /path/to/dynolog_repo/dynolog.dockerfile -t dyno_build:rocky9_build_x86 --target rocky_build_x86
docker build . -f /path/to/dynolog_repo/dynolog.dockerfile -t dyno_build:rocky9_build_x86 --target rocky9_x86
```

Note, this step may take a while if you are using an ARM based laptop/machine and building the x86 packages.
Expand Down
66 changes: 64 additions & 2 deletions dynolog.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
FROM --platform=linux/amd64 amd64/ubuntu:20.04 AS ubuntu_build_x86
FROM --platform=linux/amd64 amd64/ubuntu:20.04 AS ubuntu_x86
# This required to avoid interactive build for tzdata
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -27,7 +27,7 @@ RUN cd cli && /root/.cargo/bin/cargo +nightly build --release -Z sparse-registry

RUN ./scripts/build.sh 2>&1 | tee build.log

FROM --platform=linux/amd64 rockylinux:9 AS rocky_build_x86
FROM --platform=linux/amd64 rockylinux:9 AS rocky9_x86
RUN yum update -y && \
yum install -y \
make \
Expand All @@ -54,3 +54,65 @@ COPY . .
RUN cd cli && /root/.cargo/bin/cargo +nightly build --release -Z sparse-registry --target-dir build

RUN ./scripts/build.sh 2>&1 | tee build.log

FROM --platform=linux/amd64 rockylinux:8 AS rocky8_x86
RUN yum update -y && \
yum install -y \
make \
git \
cmake \
openssl-devel \
libstdc++ \
gcc \
gcc-c++ \
rpmdevtools.noarch \
rpmlint.noarch \
systemd-rpm-macros \
tree \
vim
RUN dnf --enablerepo=devel install -y ninja-build
# Use Rust nightly with sparse index, https://github.com/rust-lang/cargo/issues/10781
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH /root/.cargo/bin:$PATH

WORKDIR /workspace/dynolog
COPY . .

# Run the rust build directly
RUN cd cli && /root/.cargo/bin/cargo +nightly build --release -Z sparse-registry --target-dir build

RUN ./scripts/build.sh 2>&1 | tee build.log


FROM --platform=linux/amd64 centos:7 AS centos7_x86
RUN yum update -y && \
yum install -y epel-release centos-release-scl && \
yum install -y \
make \
git \
cmake3 \
openssl-devel \
libstdc++ \
gcc \
gcc-c++ \
rpmdevtools.noarch \
rpmlint.noarch \
systemd-rpm-macros \
tree \
vim \
ninja-build \
devtoolset-8-gcc*

RUN ln -s /usr/bin/cmake3 /usr/bin/cmake

# Use Rust nightly with sparse index, https://github.com/rust-lang/cargo/issues/10781
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH /root/.cargo/bin:$PATH

WORKDIR /workspace/dynolog
COPY . .

# Run the rust build directly
RUN cd cli && /root/.cargo/bin/cargo +nightly build --release -Z sparse-registry --target-dir build

RUN scl enable devtoolset-8 ./scripts/build.sh 2>&1 | tee build.log

0 comments on commit a73b884

Please sign in to comment.