Initial Commit
Build and Push Ubuntu Image / Build and push image (push) Successful in 1m4s Details

This commit is contained in:
Aditya Prima 2024-03-23 23:03:51 +07:00
parent 473b945468
commit 19f62c6621
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,33 @@
name: Build and Push Ubuntu Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: aditya.prima
password: ${{ secrets.PATOKEN }}
- name: Build and push 22.04 / jammy
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
build-args: |
UBUNTU_VERSION=jammy
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:22.04
git.winteraccess.id/${{ gitea.repository }}:jammy
git.winteraccess.id/${{ gitea.repository }}:latest

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
ARG UBUNTU_VERSION=jammy
FROM ubuntu:${UBUNTU_VERSION} AS base
LABEL maintainer="<Aditya Prima> aprimediet@gmail.com"
ARG UBUNTU_VERSION=jammy
# ARG UBUNTU_MIRROR=http://repo.ugm.ac.id/ubuntu
# ARG SECURITY_MIRROR=http://security.ubuntu.com/ubuntu
ENV DEBIAN_FRONTEND noninteractive
# ADJUST LOCAL TIME
ENV TZ Asia/Jakarta
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set User as root
USER root
# RUN touch /etc/apt/sources.list
# RUN echo "deb ${UBUNTU_MIRROR}/ ${UBUNTU_VERSION} main restricted universe multiverse" > /etc/apt/sources.list
# RUN echo "deb ${UBUNTU_MIRROR}/ ${UBUNTU_VERSION}-updates main restricted universe multiverse" >> /etc/apt/sources.list
# RUN echo "deb ${UBUNTU_MIRROR}/ ${UBUNTU_VERSION}-backports main restricted universe multiverse" >> /etc/apt/sources.list
# RUN echo "deb ${SECURITY_MIRROR}/ ${UBUNTU_VERSION}-security main restricted universe multiverse" >> /etc/apt/sources.list
# Install base dependencies
RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y update && apt -y upgrade && apt -y install bash curl
# Clean APT Cache
RUN apt -y clean