Skip to content

Commit

Permalink
chore: provide specific version of rust toolchain in Docker image (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-tarr-orica authored Oct 2, 2024
1 parent 8f43d53 commit 1773b2c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_orica_server_builder_image_versioned.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build builder for orica_server with tagged version

on:
workflow_dispatch:

jobs:
build-rust-test-image:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Login to ACR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Build and Push Image with Cache
- name: Build & Push
uses: docker/build-push-action@v3
with:
context: docker/orica_server_builder
push: true
build-args: |
RUST_VERSION=1.80
tags: |
ghcr.io/foresightminingsoftwarecorporation/orica-server-builder-versioned:rust-1.80
55 changes: 55 additions & 0 deletions docker/orica_server_builder/Dockerfile_versioned
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ubuntu:focal

WORKDIR /usr/src/
ARG RUST_VERSION=1.8.0
ARG OPENSSL_VERSION=1.1.1m

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install \
-yq --no-install-recommends \
build-essential \
cmake \
curl \
gfortran \
git \
gnupg2 \
gobject-introspection \
libasound2-dev \
libatk1.0-0 \
libcairo-gobject2 \
libexpat1-dev \
libfontconfig-dev \
libfreetype-dev \
libgdk-pixbuf2.0-0 \
libglib2.0-0 \
libgtk-3-dev \
libmkl-full-dev \
libomp-8-dev \
libpango-1.0-0 \
libssl-dev \
libudev-dev \
libxcb-composite0-dev \
lsb-release \
musl-dev \
musl-tools \
openssh-client \
pkg-config \
software-properties-common \
tzdata \
wget

# Static linking for C++ code
RUN ln -s "/usr/bin/g++" "/usr/bin/musl-g++"

# install Rust
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain $RUST_VERSION -y -t x86_64-unknown-linux-musl --profile minimal

ENV PATH=/root/.cargo/bin:$PATH
RUN rustup target add x86_64-unknown-linux-musl

# Install OpenSSl
COPY build_openssl_ubuntu.sh build_openssl_ubuntu.sh
RUN ./build_openssl_ubuntu.sh

0 comments on commit 1773b2c

Please sign in to comment.