Skip to content

Commit

Permalink
feat: add ubuntu-redis
Browse files Browse the repository at this point in the history
Added ubuntu-redis image, ubuntu version can be designated, and will install the latest redis server.
  • Loading branch information
kovercjm committed Sep 12, 2023
1 parent 3477b6d commit 0aa4541
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,29 @@ jobs:
context: ./ubuntu-sshd
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu-sshd:${{ matrix.UBUNTU_VERSION }}
build-args: UBUNTU_VERSION=${{ matrix.UBUNTU_VERSION }}

push-ubuntu-redis:
name: Publish image ubuntu-redis
runs-on: ubuntu-latest
strategy:
matrix:
UBUNTU_VERSION: ["20.04", "22.04", "latest"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Ubuntu image with sshd
uses: docker/build-push-action@v4
with:
push: true
provenance: false
platforms: linux/amd64,linux/arm64
context: ./ubuntu-redis
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu-redis:${{ matrix.UBUNTU_VERSION }}
build-args: UBUNTU_VERSION=${{ matrix.UBUNTU_VERSION }}
5 changes: 2 additions & 3 deletions golang-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}

ENV TZ="Asia/Shanghai" CGO_ENABLE=0 GOOS=linux GOARCH=amd64
ENV TZ="Asia/Shanghai" DEBIAN_FRONTEND="noninteractive"

RUN DEBIAN_FRONTEND="noninteractive" \
apt update && \
RUN apt update && \
apt install --no-install-recommends -y \
tzdata \
ca-certificates \
Expand Down
24 changes: 24 additions & 0 deletions ubuntu-redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -------------------------------------------------
# Base image for Ubuntu with redis service
#
# Author: Kover CHENG ([email protected])
# Updated: 12 Sept 2023
# -------------------------------------------------

ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}

ENV DEBIAN_FRONTEND="noninteractive"

RUN apt update && \
apt install --no-install-recommends -y \
software-properties-common \
gpg-agent \
ca-certificates

RUN add-apt-repository ppa:redislabs/redis

RUN apt update && \
apt install --no-install-recommends -y redis && \
rm -rf /var/lib/apt/lists/* && \
redis-server /etc/redis/redis.conf

0 comments on commit 0aa4541

Please sign in to comment.