Skip to content

Commit

Permalink
feat: work with ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
neverbot committed Feb 8, 2024
1 parent 286122e commit de9419c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/publish-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build and Publish to Github Container Registry

on:
push

jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login onto ghcr
run: |
docker login --username maldorne-bot --password ${{ secrets.MALDORNE_BOT_GHCR_TOKEN }} ghcr.io
- name: Build image
run: |
docker build --no-cache . -t ghcr.io/maldorne/dgd:latest
- name: Publish image
run: |
docker push ghcr.io/maldorne/dgd:latest
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# #### #### #### #### #### #### #### #### #### #### #### #### ####
# build using debian bookworm (12)
# #### #### #### #### #### #### #### #### #### #### #### #### ####

FROM debian:12-slim

# install needed tools
RUN apt-get update && apt-get install -y --force-yes git make gcc clang bison

# create group and user, with uids
RUN groupadd -g 4200 mud
RUN useradd -u 4201 -g 4200 -ms /bin/bash mud
USER mud

WORKDIR /opt/mud
COPY --chown=mud:mud . /opt/mud/driver/

WORKDIR /opt/mud/driver/src
RUN make clean
RUN make
RUN make install

# let's copy the binary to the same directory as other images
RUN cp -R /opt/mud/driver/bin/ /opt/mud/

WORKDIR /opt/mud/

# expose telnet mudos ports
EXPOSE 5000/tcp
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,21 @@ This distribution is organized as follows:
command on Unix.
- src/host
Subdirectories for various platform-dependent files.

### Added for the Maldorne fork

- Build the container image (from project base directory)

`docker build --no-cache . -t ghcr.io/maldorne/dgd:latest`

- Run the container and take a look inside using a terminal

`docker run --rm -ti ghcr.io/maldorne/dgd:latest /bin/bash`

Inside the container, in `/opt/mud`, you can find the directories `driver`
(with the source code of DGD) and `bin`, with the binaries needed
to use DGD.

- Publish the container in Docker Hub

`docker push ghcr.io/maldorne/dgd:latest`

0 comments on commit de9419c

Please sign in to comment.