mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-11-27 15:01:22 +08:00
Build Docker images and push to ghcr.io.
Also slim down the Dockerfile to only include Elvish.
This commit is contained in:
parent
b39e9212cc
commit
2563b2316f
32
.github/workflows/docker.yml
vendored
Normal file
32
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: docker
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Log in to the Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -1,13 +1,9 @@
|
|||
FROM golang:1.20-alpine as builder
|
||||
FROM golang:1.22-alpine3.19 as builder
|
||||
RUN apk add --no-cache --virtual build-deps make git
|
||||
# Build Elvish
|
||||
COPY . /go/src/src.elv.sh
|
||||
RUN make -C /go/src/src.elv.sh get
|
||||
|
||||
FROM alpine:3.18
|
||||
RUN adduser -D elf
|
||||
RUN apk update && apk add tmux mandoc man-pages vim curl sqlite git
|
||||
FROM alpine:3.19
|
||||
COPY --from=builder /go/bin/elvish /bin/elvish
|
||||
USER elf
|
||||
WORKDIR /home/elf
|
||||
CMD ["/bin/elvish"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user