Skip to content

Commit 25c397c

Browse files
authored
Git hub build (#374)
* GibHubBuild of Medley container. * Add build.yml to master * fix version * add gitHubBuild branch * cleanup * add in gitHubBuild * GibHubBuild of Medley container. * cleanup * Cleanup
1 parent b18d16b commit 25c397c

File tree

2 files changed

+94
-17
lines changed

2 files changed

+94
-17
lines changed

.github/workflows/build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# based on https://blog.oddbit.com/post/2020-09-25-building-multi-architecture-im/
2+
---
3+
# Interlisp workflow to build Docker Image that support multiple architectures
4+
name: 'Build Medley Docker image'
5+
6+
# Run this workflow on push to master
7+
on:
8+
push:
9+
branches:
10+
- master
11+
12+
# Jobs that compose this workflow
13+
jobs:
14+
# Job to build the docker image
15+
docker:
16+
runs-on: ubuntu-latest
17+
steps:
18+
# Checkout the branch
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
# Setup needed environment variables
23+
- name: Prepare
24+
id: prep
25+
run: |
26+
DOCKER_IMAGE=interlisp/${GITHUB_REPOSITORY#*/}
27+
VERSION=latest
28+
SHORTREF=${GITHUB_SHA::8}
29+
30+
# If this is git tag, use the tag name as a docker tag
31+
if [[ $GITHUB_REF == refs/tags/* ]]; then
32+
VERSION=${GITHUB_REF#refs/tags/v}
33+
fi
34+
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
35+
36+
# If the VERSION looks like a version number, assume that
37+
# this is the most recent version of the image and also
38+
# tag it 'latest'.
39+
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
40+
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
41+
fi
42+
43+
# Set output parameters.
44+
echo ::set-output name=tags::${TAGS}
45+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
46+
echo ::set-output name=build_time::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
47+
48+
# Setup Docker Machine Emulation environment
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@master
51+
with:
52+
platforms: all
53+
54+
# Setup Docker Buildx function
55+
- name: Set up Docker Buildx
56+
id: buildx
57+
uses: docker/setup-buildx-action@master
58+
59+
# Login to DockerHub - required to store the image
60+
- name: Login to DockerHub
61+
if: github.event_name != 'pull_request'
62+
uses: docker/login-action@v1
63+
with:
64+
username: ${{ secrets.DOCKER_USERNAME }}
65+
password: ${{ secrets.DOCKER_PASSWORD }}
66+
67+
# Start the Docker Build using the Dockerfilein the repository
68+
- name: Build
69+
uses: docker/build-push-action@v2
70+
with:
71+
builder: ${{ steps.buildx.outputs.name }}
72+
context: .
73+
file: ./Dockerfile
74+
# Platforms
75+
# linux/amd64 -- Standard x86_64
76+
# linux/arm64 -- Apple M1
77+
# linux/arm/v7 -- Raspberry pi
78+
platforms: linux/amd64,linux/arm64,linux/arm/v7
79+
# Push the created image
80+
push: true
81+
# tags to assign to the Docker image
82+
tags: ${{ steps.prep.outputs.tags }}

Dockerfile

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
FROM ubuntu:focal
2-
ENV DEBIAN_FRONTEND=noninteractive
1+
FROM interlisp/maiko:latest
2+
ARG BUILD_DATE
3+
LABEL name="Medley"
4+
LABEL description="The Medley Interlisp environment"
5+
LABEL url="https://github.com/Interlisp/medley"
6+
LABEL build-time=$BUILD_DATE
37

4-
RUN apt-get update && apt-get install -y build-essential clang libx11-dev
5-
COPY maiko /build/
6-
WORKDIR /build/bin
7-
RUN rm -rf /build/linux*
8-
RUN ./makeright x
9-
10-
11-
FROM ubuntu:focal
12-
ENV DEBIAN_FRONTEND=noninteractive
8+
RUN apt-get update && apt-get install -y tightvncserver
139

1410
EXPOSE 5900
1511

16-
RUN apt-get update && apt-get install -y tightvncserver
17-
RUN mkdir /app
18-
WORKDIR /app
19-
COPY basics ./
20-
COPY --from=0 /build/linux.x86_64/* ./
12+
# Need to refine this down to only needed directories.
13+
COPY . /app/medley
14+
15+
WORKDIR /app/medley
2116

2217
RUN adduser --disabled-password --gecos "" medley
2318
USER medley
24-
ENTRYPOINT USER=medley Xvnc -geometry 1270x720 :0 & DISPLAY=:0 /app/ldex -g 1280x720 full.sysout
19+
ENTRYPOINT USER=medley Xvnc -geometry 1280x720 :0 & DISPLAY=:0 PATH="/app/maiko:$PATH" ./run-medley -full -g 1280x720 -sc 1280x720

0 commit comments

Comments
 (0)