Skip to content

Commit a2880ae

Browse files
committed
ubuntu-20-user-wa
Signed-off-by: Joel Winarske <[email protected]>
1 parent 1960927 commit a2880ae

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: ubuntu20-user-wa-docker-build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- 'main'
12+
13+
env:
14+
REGISTRY_USER: ${{ github.actor }}
15+
REGISTRY_PASSWORD: ${{ github.token }}
16+
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
17+
18+
jobs:
19+
20+
ubuntu-20-user:
21+
runs-on: ubuntu-latest
22+
steps:
23+
24+
- name: Log in to ghcr.io
25+
uses: redhat-actions/[email protected]
26+
with:
27+
username: ${{ env.REGISTRY_USER }}
28+
password: ${{ env.REGISTRY_PASSWORD }}
29+
registry: ${{ env.IMAGE_REGISTRY }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- uses: mr-smithers-excellent/docker-build-push@v5
35+
name: Build & push Docker image
36+
with:
37+
image: meta-flutter/ubuntu-20-user-wa
38+
tags: main
39+
registry: ghcr.io
40+
dockerfile: ubuntu-20-user-wa/Dockerfile
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}

ubuntu-20-user-wa/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM ubuntu:20.04
2+
3+
ARG TZ=America/Los_Angeles
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ARG USER_NAME="Joel Winarske"
6+
ARG USER_EMAIL="[email protected]"
7+
ARG RUNNER_USER_UID=1001
8+
ARG DOCKER_GROUP_GID=121
9+
10+
USER root
11+
12+
RUN apt-get update
13+
RUN apt-get install -y locales openssh-client git git-core
14+
RUN apt-get install -y sudo python3 python3-pip python3-git
15+
RUN pip3 install virtualenv
16+
17+
# Runner user
18+
RUN adduser --disabled-password --gecos '' -u $RUNNER_USER_UID dev \
19+
&& groupadd docker --gid $DOCKER_GROUP_GID \
20+
&& usermod -aG sudo dev \
21+
&& usermod -aG docker dev \
22+
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
23+
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
24+
25+
RUN chown -R dev:dev /home/dev
26+
27+
RUN locale-gen en_US.UTF-8
28+
ENV LANG=en_US.UTF-8
29+
30+
USER dev
31+
32+
WORKDIR /home/dev
33+
34+
RUN echo '/home/dev/.ssh/id_rsa' | ssh-keygen -t rsa -b 2048 -C "${USER_EMAIL}"
35+
RUN git config --global user.email ${USER_EMAIL}
36+
RUN git config --global user.name "${USER_NAME}"
37+
38+
#
39+
# Install workspace automation
40+
#
41+
RUN git clone https://github.com/meta-flutter/workspace-automation.git
42+
RUN cd workspace-automation
43+
RUN PREFER_LLVM=14 ./flutter_workspace.py

0 commit comments

Comments
 (0)