Added required files

This commit is contained in:
WilliamMiceli
2019-08-20 18:47:00 -04:00
parent 93d1c9bf9f
commit 12bc8a1282
4 changed files with 80 additions and 0 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
*/.git/*

62
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,62 @@
image: docker:latest
stages:
- Build Base
- Build Variants
- Push Images
0-build-base:
stage: Build Base
artifacts:
expire_in: 1 week
paths:
- ./images/
tags:
- docker
before_script:
- mkdir ./images
script:
- docker build --pull --build-arg "MC_SERVER_VERSION=$MC_SERVER_VERSION" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
- docker save --output "./images/$CI_COMMIT_SHORT_SHA.tar" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
1A-push-dev:
stage: Push Images
dependencies:
- 0-build-base
- 1-build-git
tags:
- docker
before_script:
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin
script:
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:dev-$MC_SERVER_VERSION"
- docker push "$CI_REGISTRY_IMAGE:dev-$MC_SERVER_VERSION"
1B-push-version:
stage: Push Images
dependencies:
- 0-build-base
tags:
- docker
when: manual
before_script:
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin
script:
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:$MC_SERVER_VERSION"
- docker push "$CI_REGISTRY_IMAGE:$MC_SERVER_VERSION"
1C-push-latest:
stage: Push Images
dependencies:
- 0-build-base
tags:
- docker
when: manual
before_script:
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin
script:
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:latest"

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM ubuntu:latest
LABEL maintainer="William Miceli <git@williammiceli.me>"
USER root
ARG MC_SERVER_VERSION
# Download and setup Minecraft Server archive
#Located at https://minecraft.azureedge.net/bin-linux/bedrock-server-${MC_SERVER_VERSION}.zip
COPY /entrypoint.sh /
EXPOSE 80
CMD ["/bin/sh", "/entrypoint.sh"]

3
entrypoint.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
# Command to run: `LD_LIBRARY_PATH=. ./bedrock_server`