Skip to content

Commit

Permalink
refactor: move from ubuntu_dev to a deno image
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-gomes committed Oct 23, 2023
1 parent 375faf7 commit bebf9be
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 18 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/dockerx_deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Deno Images
on:
push:
branches-ignore:
- none
paths:
- "deno/**"
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
config:
- { dockerfile: "deno/Dockerfile", context: "deno", image_name: "deno", tag_name: "latest" }
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tag name based on branch
id: set_tag
run: |
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "tag=${{ matrix.config.tag_name }}" >> $GITHUB_OUTPUT
else
GITHUB_REFNAME=${{ github.ref_name }}
BRANCH_NAME=${GITHUB_REFNAME//\//_}
echo "tag=${{ matrix.config.tag_name }}-$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.config.context }}
file: ${{ matrix.config.dockerfile }}
platforms: linux/amd64,linux/arm64/v8
push: true
tags: hivesolutions/${{ matrix.config.image_name }}:${{ steps.set_tag.outputs.tag }}
4 changes: 2 additions & 2 deletions .github/workflows/dockerx_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:
runs-on: self-hosted
timeout-minutes: 240
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -52,6 +52,6 @@ jobs:
with:
context: ${{ matrix.config.context }}
file: ${{ matrix.config.dockerfile }}
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: hivesolutions/${{ matrix.config.image_name }}:${{ steps.set_tag.outputs.tag }}
21 changes: 21 additions & 0 deletions deno/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM hivesolutions/ubuntu:latest

LABEL version="1.0"
LABEL maintainer="Hive Solutions <[email protected]>"

ENV RUST_VERSION 1.73.0
ENV CARGO_HOME /usr/local/cargo
ENV PATH $CARGO_HOME/bin:$PATH

ENV DENO_VERSION 1.37.1

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y -q --no-install-recommends build-essential curl clang\
cmake libglib2.0-dev lld protobuf-compiler &&\
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain $RUST_VERSION -y &&\
/usr/local/cargo/bin/cargo install --locked --version $DENO_VERSION deno &&\
apt-get remove -y build-essential clang cmake libglib2.0-dev lld protobuf-compiler && apt-get autoremove -y &&\
apt-get clean && rm -rf /var/lib/apt/lists/*

CMD ["/bin/bash"]
19 changes: 3 additions & 16 deletions ubuntu_dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,11 @@ FROM hivesolutions/ubuntu:latest
LABEL version="1.0"
LABEL maintainer="Hive Solutions <[email protected]>"

ENV RUST_VERSION 1.73.0
ENV CARGO_HOME /usr/local/cargo
ENV PATH $CARGO_HOME/bin:$PATH

ENV DENO_VERSION 1.37.1

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y -q --no-install-recommends sudo gcc make curl pypy\
linux-headers-generic libssl-dev python2-dev python3-dev pypy-dev &&\
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain $RUST_VERSION -y

RUN apt-get update && apt-get install -y -q --no-install-recommends build-essential clang\
cmake libglib2.0-dev lld protobuf-compiler &&\
/usr/local/cargo/bin/cargo install --locked --version $DENO_VERSION deno &&\
apt-get remove -y build-essential clang cmake libglib2.0-dev lld protobuf-compiler && apt-get autoremove -y &&\
RUN apt-get update &&\
apt-get install -y -q --no-install-recommends sudo gcc make curl pypy linux-headers-generic\
libssl-dev python2-dev python3-dev pypy-dev &&\
apt-get clean && rm -rf /var/lib/apt/lists/*

CMD ["/bin/bash"]

0 comments on commit bebf9be

Please sign in to comment.