Updated Dockerfile to bring in specific environment variables
This commit is contained in:
14
.drone.yml
14
.drone.yml
@@ -7,7 +7,6 @@ trigger:
|
|||||||
- main
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: docker
|
- name: docker
|
||||||
@@ -41,7 +40,12 @@ steps:
|
|||||||
image: docker.io/library/docker:25.0.3-git
|
image: docker.io/library/docker:25.0.3-git
|
||||||
commands:
|
commands:
|
||||||
- sleep 10 # give docker enough time to initialize
|
- sleep 10 # give docker enough time to initialize
|
||||||
- docker image build --tag image:latest .
|
- >
|
||||||
|
docker image build
|
||||||
|
--build-arg DRONE_BUILD_STARTED=$DRONE_BUILD_STARTED
|
||||||
|
--build-arg DRONE_COMMIT_SHA=$DRONE_COMMIT_SHA
|
||||||
|
--tag image:latest
|
||||||
|
.
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run
|
path: /var/run
|
||||||
@@ -52,9 +56,6 @@ steps:
|
|||||||
- source /scratch/EXTRA_ENVIRONMENT
|
- source /scratch/EXTRA_ENVIRONMENT
|
||||||
- echo $GITEA_TOKEN | docker login git.williammiceli.systems --username $GITEA_USERNAME --password-stdin
|
- echo $GITEA_TOKEN | docker login git.williammiceli.systems --username $GITEA_USERNAME --password-stdin
|
||||||
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:latest
|
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:latest
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}; fi
|
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}; fi
|
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}.${DRONE_SEMVER_PATCH}; fi
|
|
||||||
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:app_build_id-$${APP_BUILD_ID}
|
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:app_build_id-$${APP_BUILD_ID}
|
||||||
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:ci_build-${DRONE_BUILD_NUMBER}
|
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:ci_build-${DRONE_BUILD_NUMBER}
|
||||||
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12}
|
- docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12}
|
||||||
@@ -79,9 +80,6 @@ steps:
|
|||||||
- source /scratch/EXTRA_ENVIRONMENT
|
- source /scratch/EXTRA_ENVIRONMENT
|
||||||
- echo $DOCKER_TOKEN | docker login docker.io --username $DOCKER_USERNAME --password-stdin
|
- echo $DOCKER_TOKEN | docker login docker.io --username $DOCKER_USERNAME --password-stdin
|
||||||
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:latest
|
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:latest
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}; fi
|
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}; fi
|
|
||||||
- if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}.${DRONE_SEMVER_PATCH}; fi
|
|
||||||
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:app_build_id-$${APP_BUILD_ID}
|
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:app_build_id-$${APP_BUILD_ID}
|
||||||
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:ci_build-${DRONE_BUILD_NUMBER}
|
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:ci_build-${DRONE_BUILD_NUMBER}
|
||||||
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12}
|
- docker image tag image:latest docker.io/williammiceli/satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
FROM docker.io/library/ubuntu:24.04
|
FROM docker.io/library/ubuntu:24.04
|
||||||
|
|
||||||
|
# Importing Environment Variables
|
||||||
|
ARG DRONE_BUILD_STARTED
|
||||||
|
ARG DRONE_COMMIT_SHA
|
||||||
|
|
||||||
# Avoid prompts from apt
|
# Avoid prompts from apt
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
@@ -50,6 +54,6 @@ CMD ["/home/steam/satisfactory_server/FactoryServer.sh"]
|
|||||||
|
|
||||||
# Labels
|
# Labels
|
||||||
LABEL org.opencontainers.image.authors="William Miceli; https://github.com/WilliamMiceli; https://williammiceli.me"
|
LABEL org.opencontainers.image.authors="William Miceli; https://github.com/WilliamMiceli; https://williammiceli.me"
|
||||||
LABEL org.opencontainers.image.source=https://github.com/WilliamMiceli/Docker_Satisfactory-Server
|
|
||||||
LABEL org.opencontainers.image.revision=$DRONE_COMMIT_SHA
|
|
||||||
LABEL org.opencontainers.image.created=$DRONE_BUILD_STARTED
|
LABEL org.opencontainers.image.created=$DRONE_BUILD_STARTED
|
||||||
|
LABEL org.opencontainers.image.revision=$DRONE_COMMIT_SHA
|
||||||
|
LABEL org.opencontainers.image.source=https://github.com/WilliamMiceli/Docker_Satisfactory-Server
|
||||||
|
|||||||
Reference in New Issue
Block a user