Comments (18)
You could do something like..
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
jammsen/palworld-dedicated-server
# generate Docker tags based on the following events/attributes
tags: |
type=sha
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
That would give you something like
jammsen/palworld-dedicated-server :latest
jammsen/palworld-dedicated-server:8676523
from docker-palworld-dedicated-server.
From other projects I've seen, you can accomplish this by triggering a build on tag pushes.
git tag v1.X.X
git push origin --tags
Then in your github ci, you can have something that triggers on tag creations
---
name: Create Official Release and Push Artifacts
on:
push:
tags:
- v*
And then use the docker-meta action to create a tagged release and a latest if preferred
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: docker.io/${{ github.repository }}
flavor: |
latest=${{ fromJSON(inputs.latest) }}
# for some reason can't get this to show up from docker image labels
# placing here for now
labels: |
org.opencontainers.image.description=Prometheus exporter for tdarr
tags: |
## add the event types that should be added as tags
## on release - for use by users
## version ; shorthand for {{major}}.{{minor}}.{{patch}} (can include pre-release)
type=semver,pattern={{ version }}
Then you can use the docker-build action to create the new image with latest
and semantic versioning tag
- name: Build Docker Image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ fromJSON(inputs.push) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ steps.meta.outputs.version }}
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
I've seen a similar pattern in other projects and added it to my own here as a reference: https://github.com/homeylab/tdarr-exporter/blob/main/.github/actions/docker/action.yml
from docker-palworld-dedicated-server.
- You run this image and a valid config on server1. It pulls down
latest
. You know take the same image tag and config to server2, and it would pull downlatest
, but you have no promise that its the same image.
Oh yeah then now you can just Hard-Version-Pin by sha-has and make sure you have the right version on every node of your cluster. Seems legit.
- When running in kuberenetes, it will normally check if the image already exists on the host before it tries to download it, so you can end up in a situation here it already sees
image:latest
and decides it doesnt need to pull a new image ....
Ooooh now i starting to see/get your point, well in my firm where i educate people on using docker and registries we use Harbor all the time, we do always pull from Harbor in ci-context, because it has the information if its current or not and the cache-proxies check on every request in the upstream if the sha has changed and if the new image needs to be downloaded and be cached. I think i just thought about this a little bit to ?"enterprisy"? i guess? 🤔
from docker-palworld-dedicated-server.
We actually use harbor, but anything tagged latest is actually prevented from starting up.
https://kyverno.io/policies/best-practices/disallow-latest-tag/disallow-latest-tag/
from docker-palworld-dedicated-server.
Hey @jseiser im about 75% sure what you mean, are you able to talk with me in Discord or Teamspeak to clear a few of my questions?
from docker-palworld-dedicated-server.
In the end, much of this is personal/project preference based on what you need most. For smaller projects, I would recommend a similar pattern to what I implemented here: https://github.com/homeylab/tdarr-exporter/tree/main/.github/workflows
Essentially actions on PR open, branch merge, Tagged release.
PR open -> Test/lint, etc.
Merge into main -> trigger build and deploy to main
tag in dockerhub. This tag is for latest code in repo and not considered stable.
Tag Push -> trigger build of latest
and X.X.X
tag build. Users can pin app to the tag or pull latest.
Example:
tag | description |
---|---|
latest |
Latest stable release and is updated with each new release. |
X.X.X |
Semantic versioned releases are also provided if preferred for stability or other reasons. |
main |
This tag reflects the main branch of this repository and may not be stable |
This pattern works fine (imo) for small projects. Industry CI/CD is much more focused on testing and leveraging temporary/JIT compute to do more integration and E2E testing before reaching production but for github projects, the method I described may work out well for you
Hope this helps!
from docker-palworld-dedicated-server.
If I get some time, I'll open a PR to get the ball rolling, if needed/wanted, to help get the outline of this process in the yaml github files.
from docker-palworld-dedicated-server.
This pattern works fine (imo) for small projects. Industry CI/CD is much more focused on testing and leveraging temporary/JIT compute to do more integration and E2E testing before reaching production but for github projects, the method I described may work out well for you
Hmmm yeah im doing DevOps work at my company i know and teach this, though with 2 other products then GH.
Im just thinking about what i want here (some easy, maybe shortended version of sha-commit-hash) and what i really like (https://hub.docker.com/_/debian and https://hub.docker.com/_/ubuntu have a really well organized site with multiplate tags to stay up to date, but also version pin if needed very hard) and which version it should be (as a single guy doing this, i would have it rather small and automated heavily, than very complex). And yes sometimes im one of the guys who surely forgets to tag or to push with tags, happend in the past and will in the future 😎
If I get some time, I'll open a PR to get the ball rolling, if needed/wanted, to help get the outline of this process in the yaml github files.
Dont just spend hours of work on a PR that i might not want to use, thats why i asked @jseiser if he has time to do a call in voice to better unterstand this and have someone to brainstorm on this. I would rather have this than the code i maybe dont use and someone is mad at me 😭
from docker-palworld-dedicated-server.
Sorry im traveling for work this week.
In our projects we generate tags based off of git commits, thats probably over kill for something of this size. Just any unique tag would be great, so we dont run into issues of docker caching the latest
tag.
from docker-palworld-dedicated-server.
Sorry im traveling for work this week.
In our projects we generate tags based off of git commits, thats probably over kill for something of this size. Just any unique tag would be great, so we dont run into issues of docker caching the
latest
tag.
What do you mean by that? Isnt Docker supposed to cache this? Or what do you consider problems?
from docker-palworld-dedicated-server.
Not sure how this should be helping in your request and the cache-problem i just dont understand, please explain in voice when you back at home.
from docker-palworld-dedicated-server.
latest as always, master for branch name and GIT_SHA shortend to 7 chars
from docker-palworld-dedicated-server.
what you just posted ill work perfect.
from docker-palworld-dedicated-server.
@jseiser happy that helps, but please help me solve my confusion
Not sure how this should be helping in your request and the cache-problem i just dont understand, please explain in voice when you back at home.
Please answer this.
from docker-palworld-dedicated-server.
The tag latest
is mutable, it changes what it references over time.
- You run this image and a valid config on server1. It pulls down
latest
. You know take the same image tag and config to server2, and it would pull downlatest
, but you have no promise that its the same image. - When running in kuberenetes, it will normally check if the image already exists on the host before it tries to download it, so you can end up in a situation here it already sees
image:latest
and decides it doesnt need to pull a new image, putting you back in the same situation as #1
from docker-palworld-dedicated-server.
Guess it depends on your work bubble then :D
In my firm we avoid latest
for anything that goes in production at all cost.
You have no way of rolling back to a different version if everything is latest
;)
Not to mention, that you can never figure out what version you are actually running, unless you added some different information like docker labels.
from docker-palworld-dedicated-server.
Guess it depends on your work bubble then :D
In my firm we avoid
latest
for anything that goes in production at all cost.You have no way of rolling back to a different version if everything is
latest
;)Not to mention, that you can never figure out what version you are actually running, unless you added some different information like docker labels.
Thats why im trying to teach everyone to hardcore use Version-Pinning and not even like Node:18 tags and stuff like that.
Sorry if that came across as weird written.
from docker-palworld-dedicated-server.
Thanks for the awesome exchange of experiences! I value that very highly!
Is this issue resolved?
Please consider giving this repo and the docker-hub-repo a star.
from docker-palworld-dedicated-server.
Related Issues (20)
- [Bug Report] Player join/left issue with character creation HOT 1
- [Bug Report] Player join/leave cannot have commas in name HOT 1
- [Bug Report] Player join/leave doesn't work with players of the same name HOT 1
- [Bug Report] Crash Loop (LowLevelFatalError) HOT 4
- [Feature Request] Automatic Restart should not wait 15 minutes when no player is on the server
- [Bug Report] RCON Port setting change in 1.50 HOT 6
- [Bug Report] Error when auto restart HOT 3
- docker部署后无法正常使用RCON,cli: execute: auth: rcon: dial tcp: lookup tcp/###RCON_PORT###:unknown port HOT 6
- [Feature Request] Make gosu-binary building more transparent
- [Bug Report] Log file consumes all remaining HDD space associated with Docker system HOT 3
- [Feature Request] Implement server OoM crash detection and restart HOT 2
- [Bug Report] RCON Log gets cut off
- [Bug Report] New alias for rconcli with timestamp
- [Bug Report] After docker container update Server failed to start with permission denied HOT 11
- [Bug Report] Container backups also backup the Palworld built-in backups HOT 1
- [Bug Report] Automatic Restart stopped working HOT 2
- [Question] 您好,我在游戏中,会接受到容器显示的备份 通知,我想询问下这个备份通知能否不在游戏内显示,可以在容器日志中 HOT 3
- [Feature Request] use semantic versioning HOT 7
- [Bug Report] No config found, generating one HOT 3
- [Bug Report] Your descriptive title here! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-palworld-dedicated-server.