Closed malcyon closed 3 years ago
The Dockerhub build rules for graylog
were previously:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /.*/ | {sourceref} | Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | Dockerfile | / |
For the graylog
image, I have changed them to:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+).*/ | {sourceref} | docker/oss/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | docker/oss/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | docker/oss/Dockerfile | / |
For the graylog-enterprise
image, I have changed them to:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+).*/ | {sourceref} | docker/enterprise/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | docker/enterprise/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | docker/enterprise/Dockerfile | / |
This will ensure that when we create a tag like 4.0.1-1
, that we will get images tagged with:
It will also ensure that tags like forwarder-3.3.9
don't trigger builds for the other images.
The graylog-forwarder
regexes are:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /forwarder-.*/ | {sourceref} | docker/forwarder/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | docker/forwarder/Dockerfile | / |
Tag | /^([0-9]+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | docker/forwarder/Dockerfile | / |
This creates tags for graylog-forwarder
like:
For future reference, when dockerhub fails to match its regex for a tag, you can tell by checking the webhooks in the github repo. There will be a failed webhook with an http 500 error, saying:
{"error": "Our service is temporarily unavailable. We'll be back soon!"}
That is a clue that the regex is wrong.
You can also redeliver failed webhooks from github after fixing the regex.
@bernd Alright, you rightly pointed out that this could be a problem when we do a new 3.3 release, because it would be looking for the Dockerfile in the wrong place. I propose this solution:
For the graylog
image:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /^([0-3]).([0-9]+).([0-9]+)-([0-9]+).*/ | {sourceref} | Dockerfile | / |
Tag | /^([0-3]).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | Dockerfile | / |
Tag | /^([0-3]).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | Dockerfile | / |
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+).*/ | {sourceref} | docker/oss/Dockerfile | / |
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | docker/oss/Dockerfile | / |
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | docker/oss/Dockerfile | / |
For the graylog-enterprise
image:
Source Type | Source | Docker Tag | Dockerfile location | Build Context |
---|---|---|---|---|
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+).*/ | {sourceref} | docker/enterprise/Dockerfile | / |
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2} | docker/enterprise/Dockerfile | / |
Tag | /^([4-9]|\d\{2,\}+).([0-9]+).([0-9]+)-([0-9]+)$/ | {\1}.{\2}.{\3} | docker/enterprise/Dockerfile | / |
Some thoughts:
Dockerfile
in the root directory.docker/oss
or docker/enterprise
directory.docker/
directory.graylog-enterprise
image won't build for 3.X or lower.
Since the Dockerfile is now in a subdirectory, the hook directory needs to be moved.
Per the docs:
https://docs.docker.com/docker-hub/builds/advanced/
I forked the github repo and the dockerhub repo to test this new setup and it does work.
I've also created new dockerhub repos for
graylog-forwarder
andgraylog-enterprise
. Splitting up the hook files like this will ensure that each dockerhub repo only builds the intended image.The
graylog
andgraylog-enterprise
builds will be kicked off (as usual) via the4.0.1-1
style tag. Thegraylog-forwarder
image build will be kicked off withforwarder-4.0.1-1
style tags.The regexes in the dockerhub build logic have been updated so that
graylog
andgraylog-enterprise
images don't build when we create aforwarder-X.X.X
tag.