mirror of
https://github.com/mentos1386/dotfiles.git
synced 2025-01-31 08:45:46 +00:00
feat(packages): add mosh from master
This commit is contained in:
parent
b565a90685
commit
779f252954
5 changed files with 115 additions and 2 deletions
53
.github/workflows/packages.yaml
vendored
53
.github/workflows/packages.yaml
vendored
|
@ -167,3 +167,56 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
||||||
|
|
||||||
|
mosh:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare
|
||||||
|
id: prepare
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=ghcr.io/mentos1386/mosh
|
||||||
|
DOCKER_PLATFORMS=linux/amd64,linux/arm64
|
||||||
|
VERSION=master
|
||||||
|
|
||||||
|
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:latest"
|
||||||
|
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
echo ::set-output name=version::${VERSION}
|
||||||
|
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||||
|
--build-arg VERSION=${VERSION} \
|
||||||
|
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||||
|
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
||||||
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
|
${TAGS} --file ./packages/Dockerfile.mosh .
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-mosh-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-mosh-
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Docker Buildx (build)
|
||||||
|
run: |
|
||||||
|
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
|
||||||
|
- name: Login to Github Registry
|
||||||
|
if: success() && github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
- name: Docker Buildx (push)
|
||||||
|
if: success() && github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
|
||||||
|
- name: Inspect image
|
||||||
|
if: always() && github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ RUN set -ueox pipefail \
|
||||||
&& apt-get -yqq --no-install-recommends --no-install-suggests install \
|
&& apt-get -yqq --no-install-recommends --no-install-suggests install \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
locales \
|
locales \
|
||||||
mosh \
|
perl \
|
||||||
openssh-server \
|
openssh-server \
|
||||||
psmisc \
|
psmisc \
|
||||||
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
|
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
|
||||||
|
@ -54,6 +54,7 @@ RUN set -ueox pipefail \
|
||||||
COPY --from=ghcr.io/mentos1386/starship:0.47.0 /usr/local/bin/starship /usr/local/bin/starship
|
COPY --from=ghcr.io/mentos1386/starship:0.47.0 /usr/local/bin/starship /usr/local/bin/starship
|
||||||
COPY --from=ghcr.io/mentos1386/kubectl:1.20.0 /usr/local/bin/kubectl /usr/local/bin/kubectl
|
COPY --from=ghcr.io/mentos1386/kubectl:1.20.0 /usr/local/bin/kubectl /usr/local/bin/kubectl
|
||||||
COPY --from=ghcr.io/mentos1386/glow:1.3.0 /usr/local/bin/glow /usr/local/bin/glow
|
COPY --from=ghcr.io/mentos1386/glow:1.3.0 /usr/local/bin/glow /usr/local/bin/glow
|
||||||
|
COPY --from=ghcr.io/mentos1386/mosh:master /usr/local/bin/mosh /usr/local/bin/mosh
|
||||||
# Golang
|
# Golang
|
||||||
COPY --from=golang:1.15.6 --chown=${SSH_USER} /usr/local/go /home/${SSH_USER}/.go
|
COPY --from=golang:1.15.6 --chown=${SSH_USER} /usr/local/go /home/${SSH_USER}/.go
|
||||||
ENV PATH=/home/${SSH_USER}/.go/bin:$PATH
|
ENV PATH=/home/${SSH_USER}/.go/bin:$PATH
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -10,7 +10,10 @@ build-package-kubectl:
|
||||||
@docker buildx build --load -t ${REGISTRY}/kubectl:1.20.0 -f packages/Dockerfile.kubectl packages/
|
@docker buildx build --load -t ${REGISTRY}/kubectl:1.20.0 -f packages/Dockerfile.kubectl packages/
|
||||||
|
|
||||||
build-package-glow:
|
build-package-glow:
|
||||||
@docker buildx build --progress plain --load -t ${REGISTRY}/glow:1.3.0 -f packages/Dockerfile.glow packages/
|
@docker buildx build --load -t ${REGISTRY}/glow:1.3.0 -f packages/Dockerfile.glow packages/
|
||||||
|
|
||||||
|
build-package-mosh:
|
||||||
|
@docker buildx build --load -t ${REGISTRY}/mosh:master -f packages/Dockerfile.mosh packages/
|
||||||
|
|
||||||
build-packages: package-kubectl package-starship
|
build-packages: package-kubectl package-starship
|
||||||
|
|
||||||
|
|
52
packages/Dockerfile.mosh
Normal file
52
packages/Dockerfile.mosh
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
FROM debian:10.7 as build
|
||||||
|
|
||||||
|
WORKDIR /usr/src/mosh
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
|
RUN set -ueox pipefail \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get -yqq update \
|
||||||
|
&& apt-get -yqq --no-install-recommends --no-install-suggests install \
|
||||||
|
ca-certificates \
|
||||||
|
git \
|
||||||
|
autotools-dev \
|
||||||
|
perl \
|
||||||
|
protobuf-compiler \
|
||||||
|
libprotobuf-dev \
|
||||||
|
dh-autoreconf \
|
||||||
|
pkg-config \
|
||||||
|
libutempter-dev \
|
||||||
|
zlib1g-dev \
|
||||||
|
libncurses5-dev \
|
||||||
|
libssl-dev \
|
||||||
|
locales \
|
||||||
|
tmux \
|
||||||
|
less \
|
||||||
|
bash-completion \
|
||||||
|
g++ \
|
||||||
|
&& apt-get -yqq clean all \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
/tmp/* \
|
||||||
|
/var/tmp/*
|
||||||
|
|
||||||
|
ARG VERSION=master
|
||||||
|
|
||||||
|
RUN git clone https://github.com/mobile-shell/mosh.git \
|
||||||
|
--branch $VERSION \
|
||||||
|
--depth 1 .
|
||||||
|
RUN ./autogen.sh
|
||||||
|
RUN ./configure --enable-compile-warnings=error
|
||||||
|
RUN make
|
||||||
|
RUN make install
|
||||||
|
|
||||||
|
FROM alpine:3
|
||||||
|
LABEL maintainer="Tine <mentos1386> Jozelj <tine@tjo.space>"
|
||||||
|
LABEL org.opencontainers.image.source https://github.com/mentos1386/workspace
|
||||||
|
|
||||||
|
RUN apk --no-cache add perl
|
||||||
|
|
||||||
|
COPY --from=build /usr/local/bin/mosh /usr/local/bin/mosh
|
||||||
|
|
||||||
|
ENTRYPOINT /usr/local/bin/mosh
|
||||||
|
|
|
@ -29,3 +29,7 @@ version = "0.47.0"
|
||||||
name = "glow"
|
name = "glow"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
|
|
||||||
|
[[templates."package-action".vars.jobs]]
|
||||||
|
name = "mosh"
|
||||||
|
version = "master"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue