Skip to content

Compile by docker #18

Closed
Closed
@Smityz

Description

@Smityz

I think it's best to use Docker to compile a C++ project, to ensure consistency between the compilation environment and the production environment. I've written a Dockerfile based on CentOS 7 for this purpose, and I hope it can be merged into the master branch, and used as the foundation for developing a CI pipeline.

FROM centos:7.9.2009

RUN yum -y install centos-release-scl \
                   epel-release; \
                   yum -y install devtoolset-7-gcc \
                   devtoolset-7-gcc-c++ \
                   python3 \
                   make \
                   libtool \
                   openssl-devel \
                   yum clean all; \
                   rm -rf /var/cache/yum;

ENV PATH /opt/rh/devtoolset-7/root/bin/:$PATH
RUN pip3 install --upgrade pip --no-cache-dir && pip3 install --no-cache-dir cmake==3.26.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo
ENV PATH $CARGO_HOME/bin:$PATH
RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \
    curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.70.0 && \
    chmod -R a=rwX $CARGO_HOME
RUN cargo install cxxbridge-cmd --version 1.0.18

WORKDIR /client-cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions