Skip to content

Commit

Permalink
No longer building image to Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Kosmaczewski committed Mar 28, 2023
1 parent a5abb5b commit 62ab1c5
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 47 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Create and publish a Docker image

on:
push:
branches: ['main']
tags: ['*']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@219c305e1ce92a755f3aa4ba17387c95df31e987
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
40 changes: 0 additions & 40 deletions .github/workflows/docker-image.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Step 1: Build the application
FROM node:19-alpine3.17 AS builder
FROM docker.io/library/node:19-alpine3.17 AS builder

RUN npm install -g pkg pkg-fetch
ENV NODE node10
Expand All @@ -18,7 +18,7 @@ RUN /usr/local/bin/pkg --targets ${NODE}-${PLATFORM}-${ARCH} dist/index.js -o se


# Step 2: Create the runtime image
FROM alpine:3.17
FROM docker.io/library/alpine:3.17
RUN apk add --no-cache libstdc++
COPY index /site/index
COPY --from=builder /app/server.bin /node/bin/server
Expand Down
10 changes: 5 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ Use the following command after compilation:

`npm run start`

== Building the Docker Image
== Building the Container Image

Run the following command:

`docker build -t vshn/embedded-search-engine .`
`podman build -t embedded-search-engine .`

A prebuilt Docker image is available at https://hub.docker.com/r/vshn/embedded-search-engine[Docker Hub.]
A prebuilt container image is available as a package in this project.

== Running the Search Engine Docker Image
== Running the Search Engine Container Image

Use the following command:

`docker run -d -p 8081:3000 vshn/embedded-search-engine`
`podman run --detach --publish 8081:3000 ghcr.io/vshn/embedded-search-engine`

Test the search engine with a curl command piped to https://stedolan.github.io/jq/[jq]:

Expand Down

0 comments on commit 62ab1c5

Please sign in to comment.