Skip to content

Commit

Permalink
add scripts, label and rename package name
Browse files Browse the repository at this point in the history
  • Loading branch information
itsibitzi committed Jun 26, 2024
1 parent 9eadf24 commit fd5dca5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM node:latest

# This is just metadata to get our package to appear in the repo
LABEL org.opencontainers.image.source https://github.com/guardian/tech-time-container-example

# Create a directory for our application
WORKDIR /opt/example/

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "container-tech-time",
"name": "tech-time-container-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down
8 changes: 8 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_PATH=$( cd "$(dirname "$0")" || exit ; pwd -P )

pushd "${SCRIPT_PATH}/.." || exit

# This builds your docker image
docker build --tag 'ghcr.io/guardian/tech-time-container-example' .
10 changes: 10 additions & 0 deletions scripts/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

echo 'Attempting to push our example app into GHCR...'

docker image push 'ghcr.io/guardian/tech-time-container-example'

if [ "$?" == "1" ];
then
echo 'Got an error from docker, are you logged into ghcr.io?' >&2
fi

0 comments on commit fd5dca5

Please sign in to comment.