Browse Source

Generate docker file table

feature/auto_ssh
nicolas.dorier 6 years ago
parent
commit
66c20cfa39
  1. 43
      README.md
  2. 16
      contrib/DockerFileBuildHelper/Image.cs
  3. 105
      contrib/DockerFileBuildHelper/Program.cs
  4. 2
      contrib/DockerFileBuildHelper/update-repo.ps1
  5. 2
      contrib/DockerFileBuildHelper/update-repo.sh

43
README.md

@ -304,6 +304,49 @@ Note that BTCPayServer developers will not spend excessive time testing your ima
# Support
We are trying to update our dependencies to run on `arm32v7` and `x64` boards. Here is our progress:
| Source | Image | Version | x64 | arm32v7 | links |
|---|---|---|:-:|:-:|:-:|
| * | btcpayserver/docker-compose-generator | latest | [✔️](https://raw.githubusercontent.com/btcpayserver/btcpayserver-docker/dcg-latest/docker-compose-generator/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/btcpayserver-docker/dcg-latest/docker-compose-generator/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/btcpayserver-docker) - [DockerHub](https://hub.docker.com/r/btcpayserver/docker-compose-generator) |
| * | btcpayserver/docker-compose-builder | 1.23.2 | ️❌ | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-compose-builder/v1.23.2/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/docker-compose-builder) - [DockerHub](https://hub.docker.com/r/btcpayserver/docker-compose-builder) |
| bitcoin.yml | btcpayserver/bitcoin | 0.17.0 | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Bitcoin/0.17.0/Bitcoin/0.17.0/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Bitcoin/0.17.0/Bitcoin/0.17.0/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/dockerfile-deps) - [DockerHub](https://hub.docker.com/r/btcpayserver/bitcoin) |
| bitcoin-clightning.yml | btcpayserver/lightning | v0.6.3-4 | [✔️](https://raw.githubusercontent.com/btcpayserver/lightning/basedon-v0.6.3-4/Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/lightning/basedon-v0.6.3-4/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/lightning) - [DockerHub](https://hub.docker.com/r/btcpayserver/lightning) |
| bitcoin-clightning.yml | shesek/lightning-charge | 0.4.6-standalone | [✔️](https://raw.githubusercontent.com/ElementsProject/lightning-charge/v0.4.6/Dockerfile) | ️❌ | [Github](https://github.com/ElementsProject/lightning-charge) - [DockerHub](https://hub.docker.com/r/shesek/lightning-charge) |
| bitcoin-clightning.yml | shesek/spark-wallet | 0.2.2-standalone | [✔️](https://raw.githubusercontent.com/shesek/spark-wallet/v0.2.2/Dockerfile) | ️❌ | [Github](https://github.com/shesek/spark-wallet) - [DockerHub](https://hub.docker.com/r/shesek/spark-wallet) |
| bitcoin-lnd.yml | btcpayserver/lnd | v0.5.1-beta-2 | [✔️](https://raw.githubusercontent.com/btcpayserver/lnd/basedon-v0.5.1-beta-2/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/lnd/basedon-v0.5.1-beta-2/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/lnd) - [DockerHub](https://hub.docker.com/r/btcpayserver/lnd) |
| btcpayserver.yml | btcpayserver/btcpayserver | 1.0.3.48 | [✔️](https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.48/Dockerfile.linuxamd64) | [✔️](https://raw.githubusercontent.com/btcpayserver/btcpayserver/v1.0.3.48/Dockerfile.linuxarm32v7) | [Github](https://github.com/btcpayserver/btcpayserver) - [DockerHub](https://hub.docker.com/r/btcpayserver/btcpayserver) |
| dash.yml | btcpayserver/dash | 0.12.3 | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Dash/0.12.3/Dash/0.12.3/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Dash/0.12.3/Dash/0.12.3/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/dockerfile-deps) - [DockerHub](https://hub.docker.com/r/btcpayserver/dash) |
| dogecoin.yml | rockstardev/dogecoin | 1.10.0 | [✔️](https://raw.githubusercontent.com/rockstardev/docker-bitcoin/feature/dogecoin/dogecoin/1.10.0/Dockerfile) | ️❌ | [Github](https://github.com/rockstardev/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/rockstardev/dogecoin) |
| feathercoin.yml | chekaz/docker-feathercoin | 0.16.3 | [✔️](https://raw.githubusercontent.com/ChekaZ/docker/master/feathercoin/0.16.3/Dockerfile) | ️❌ | [Github](https://github.com/ChekaZ/docker) - [DockerHub](https://hub.docker.com/r/chekaz/docker-feathercoin) |
| groestlcoin.yml | nicolasdorier/docker-groestlcoin | 2.16.3 | [✔️](https://raw.githubusercontent.com/NicolasDorier/docker-bitcoin/master/groestlcoin/2.16.3/Dockerfile) | ️❌ | [Github](https://github.com/NicolasDorier/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/nicolasdorier/docker-groestlcoin) |
| groestlcoin-clightning.yml | groestlcoin/lightning | v0.6.2-2 | [✔️](https://raw.githubusercontent.com/Groestlcoin/lightning/v0.6.2-2/Dockerfile) | ️❌ | [Github](https://github.com/Groestlcoin/lightning) - [DockerHub](https://hub.docker.com/r/groestlcoin/lightning) |
| groestlcoin-clightning.yml | groestlcoin/groestlcoin-lightning-charge | version-0.4.6 | [✔️](https://raw.githubusercontent.com/Groestlcoin/groestlcoin-lightning-charge/v0.4.6/Dockerfile) | ️❌ | [Github](https://github.com/Groestlcoin/groestlcoin-lightning-charge) - [DockerHub](https://hub.docker.com/r/groestlcoin/groestlcoin-lightning-charge) |
| groestlcoin-clightning.yml | groestlcoin/groestlcoin-spark | version-0.2.2 | [✔️](https://raw.githubusercontent.com/Groestlcoin/groestlcoin-spark/v0.2.2-1/Dockerfile) | ️❌ | [Github](https://github.com/Groestlcoin/groestlcoin-spark) - [DockerHub](https://hub.docker.com/r/groestlcoin/groestlcoin-spark) |
| litecoin.yml | nicolasdorier/docker-litecoin | 0.16.3 | [✔️](https://raw.githubusercontent.com/NicolasDorier/docker-bitcoin/master/litecoin/0.16.3/Dockerfile) | ️❌ | [Github](https://github.com/NicolasDorier/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/nicolasdorier/docker-litecoin) |
| litecoin-clightning.yml | btcpayserver/lightning | v0.6.3-4 | [✔️](https://raw.githubusercontent.com/btcpayserver/lightning/basedon-v0.6.3-4/Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/lightning/basedon-v0.6.3-4/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/lightning) - [DockerHub](https://hub.docker.com/r/btcpayserver/lightning) |
| litecoin-lnd.yml | btcpayserver/lnd | v0.5.1-beta-2 | [✔️](https://raw.githubusercontent.com/btcpayserver/lnd/basedon-v0.5.1-beta-2/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/lnd/basedon-v0.5.1-beta-2/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/lnd) - [DockerHub](https://hub.docker.com/r/btcpayserver/lnd) |
| monacoin.yml | wakiyamap/docker-monacoin | 0.16.3 | [✔️](https://raw.githubusercontent.com/wakiyamap/docker-bitcoin/master/monacoin/0.16.3/Dockerfile) | ️❌ | [Github](https://github.com/wakiyamap/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/wakiyamap/docker-monacoin) |
| nbxplorer.yml | nicolasdorier/nbxplorer | 2.0.0.11 | [✔️](https://raw.githubusercontent.com/dgarage/nbxplorer/v2.0.0.11/Dockerfile.linuxamd64) | [✔️](https://raw.githubusercontent.com/dgarage/nbxplorer/v2.0.0.11/Dockerfile.linuxarm32v7) | [Github](https://github.com/dgarage/nbxplorer) - [DockerHub](https://hub.docker.com/r/nicolasdorier/nbxplorer) |
| nginx.yml | nginx | stable | [✔️](https://raw.githubusercontent.com/nginxinc/docker-nginx/master/stable/stretch/Dockerfile) | ️❌ | [Github](https://github.com/nginxinc/docker-nginx) - [DockerHub](https://hub.docker.com/_/nginx) |
| nginx.yml | btcpayserver/docker-gen | 0.7.4 | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-gen/v0.7.4/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-gen/v0.7.4/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/docker-gen) - [DockerHub](https://hub.docker.com/r/btcpayserver/docker-gen) |
| nginx.yml | btcpayserver/letsencrypt-nginx-proxy-companion | 1.10.0 | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-letsencrypt-nginx-proxy-companion/v1.10.0/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-letsencrypt-nginx-proxy-companion/v1.10.0/linuxarm32v7.Dockerfile) | [Github](https://github.com/btcpayserver/docker-letsencrypt-nginx-proxy-companion) - [DockerHub](https://hub.docker.com/r/btcpayserver/letsencrypt-nginx-proxy-companion) |
| opt-add-btcqbo.yml | jvandrew/btcqbo | 0.2.12 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/btcqbo/v0.2.12/Dockerfile) | ️❌ | [Github](https://github.com/JeffVandrewJr/btcqbo) - [DockerHub](https://hub.docker.com/r/jvandrew/btcqbo) |
| opt-add-btcqbo.yml | jvandrew/btcqbo | 0.2.12 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/btcqbo/v0.2.12/Dockerfile) | ️❌ | [Github](https://github.com/JeffVandrewJr/btcqbo) - [DockerHub](https://hub.docker.com/r/jvandrew/btcqbo) |
| opt-add-btcqbo.yml | redis | 5.0.2-alpine | [✔️](https://raw.githubusercontent.com/docker-library/redis/f1a8498333ae3ab340b5b39fbac1d7e1dc0d628c/5.0/Dockerfile) | ️❌ | [Github](https://github.com/docker-library/redis) - [DockerHub](https://hub.docker.com/_/redis) |
| opt-add-librepatron.yml | jvandrew/librepatron | 0.6.71 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/patron/v0.6.71/Dockerfile) | ️❌ | [Github](https://github.com/JeffVandrewJr/patron) - [DockerHub](https://hub.docker.com/r/jvandrew/librepatron) |
| opt-add-librepatron.yml | jvandrew/isso | atron.22 | [✔️](https://raw.githubusercontent.com/JeffVandrewJr/isso/patron.22/Dockerfile) | ️❌ | [Github](https://github.com/JeffVandrewJr/isso) - [DockerHub](https://hub.docker.com/r/jvandrew/isso) |
| opt-add-woocommerce.yml | btcpayserver/docker-woocommerce | 3.0.5 | [✔️](https://raw.githubusercontent.com/btcpayserver/docker-woocommerce/v3.0.5/Dockerfile) | ️❌ | [Github](https://github.com/btcpayserver/docker-woocommerce) - [DockerHub](https://hub.docker.com/r/btcpayserver/docker-woocommerce) |
| opt-add-woocommerce.yml | mariadb | 10.3 | [✔️](https://raw.githubusercontent.com/docker-library/mariadb/master/10.3/Dockerfile) | ️❌ | [Github](https://github.com/docker-library/mariadb) - [DockerHub](https://hub.docker.com/_/mariadb) |
| postgres.yml | postgres | 9.6.5 | [✔️](https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile) | [✔️](https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile) | [Github](https://github.com/docker-library/postgres) - [DockerHub](https://hub.docker.com/_/postgres) |
| traefik.yml | traefik | latest | [✔️](https://raw.githubusercontent.com/containous/traefik-library-image/master/scratch/amd64/Dockerfile) | [✔️](https://raw.githubusercontent.com/containous/traefik-library-image/master/scratch/arm/Dockerfile) | [Github](https://github.com/containous/traefik-library-image) - [DockerHub](https://hub.docker.com/_/traefik) |
| trezarcoin.yml | chekaz/docker-trezarcoin | 0.13.0 | [✔️](https://raw.githubusercontent.com/ChekaZ/docker/master/trezarcoin/1.2.0/Dockerfile) | ️❌ | [Github](https://github.com/ChekaZ/docker) - [DockerHub](https://hub.docker.com/r/chekaz/docker-trezarcoin) |
| viacoin.yml | romanornr/docker-viacoin | 0.15.2 | [✔️](https://raw.githubusercontent.com/viacoin/docker-viacoin/master/viacoin/0.15.2/docker-viacoin) | ️❌ | [Github](https://github.com/viacoin/docker-viacoin) - [DockerHub](https://hub.docker.com/r/romanornr/docker-viacoin) |
| bgold.yml | kamigawabul/docker-bitcoingold | 0.15.2 | [✔️](https://raw.githubusercontent.com/Vutov/docker-bitcoin/master/bitcoingold/0.15.2/Dockerfile) | ️❌ | [Github](https://github.com/Vutov/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/kamigawabul/docker-bitcoingold) |
| bgold-lnd.yml | kamigawabul/btglnd | latest | [✔️](https://raw.githubusercontent.com/vutov/lnd/master/BTCPayServer.Dockerfile) | ️❌ | [Github](https://github.com/vutov/lnd) - [DockerHub](https://hub.docker.com/r/kamigawabul/btglnd) |
| bitcoinplus.yml | chekaz/docker-bitcoinplus | 2.7.0 | [✔️](https://raw.githubusercontent.com/ChekaZ/docker/master/bitcoinplus/2.7.0/Dockerfile) | ️❌ | [Github](https://github.com/ChekaZ/docker) - [DockerHub](https://hub.docker.com/r/chekaz/docker-bitcoinplus) |
| bitcore.yml | dalijolijo/docker-bitcore | 0.15.2 | [✔️](https://raw.githubusercontent.com/dalijolijo/btcpayserver-docker-bitcore/master/btx-debian/Dockerfile) | ️❌ | [Github](https://github.com/dalijolijo/btcpayserver-docker-bitcore) - [DockerHub](https://hub.docker.com/r/dalijolijo/docker-bitcore) |
# FAQ
## How can I modify my environment?

16
contrib/DockerFileBuildHelper/Image.cs

@ -21,11 +21,13 @@ namespace DockerFileBuildHelper
}
}
public string Source { get; set; }
public static Image Parse(string str)
{
//${BTCPAY_IMAGE: -btcpayserver / btcpayserver:1.0.3.21}
var variableMatch = Regex.Match(str, @"\$\{[^-]+-([^\}]+)\}");
if(variableMatch.Success)
if (variableMatch.Success)
{
str = variableMatch.Groups[1].Value;
}
@ -40,15 +42,21 @@ namespace DockerFileBuildHelper
img.Tag = "latest";
return img;
}
public override string ToString()
{
return ToString(true);
}
public string ToString(bool includeTag)
{
StringBuilder builder = new StringBuilder();
if (!String.IsNullOrWhiteSpace(User))
builder.Append($"{User}/");
builder.Append($"{Name}");
if (!String.IsNullOrWhiteSpace(Tag))
builder.Append($":{Tag}");
if (includeTag)
{
if (!String.IsNullOrWhiteSpace(Tag))
builder.Append($":{Tag}");
}
return builder.ToString();
}
}

105
contrib/DockerFileBuildHelper/Program.cs

@ -14,23 +14,30 @@ namespace DockerFileBuildHelper
{
class Program
{
class Options
{
public string BuildAllScriptOutput { get; set; }
public string READMEOutput { get; set; }
}
static int Main(string[] args)
{
string outputFile = null;
var opts = new Options();
for (int i = 0; i < args.Length; i++)
{
if (args[i] == "-o")
outputFile = args[i + 1];
opts.BuildAllScriptOutput = args[i + 1];
if (args[i] == "-omd")
opts.READMEOutput = args[i + 1];
}
return new Program().Run(outputFile) ? 0 : 1;
return new Program().Run(opts) ? 0 : 1;
}
private bool Run(string outputFile)
private bool Run(Options options)
{
var fragmentDirectory = Path.GetFullPath(Path.Combine(FindRoot("contrib"), "..", "docker-compose-generator", "docker-fragments"));
List<Task<bool>> downloading = new List<Task<bool>>();
List<DockerInfo> dockerInfos = new List<DockerInfo>();
foreach(var image in new[]
foreach (var image in new[]
{
Image.Parse("btcpayserver/docker-compose-generator"),
Image.Parse("btcpayserver/docker-compose-builder:1.23.2"),
@ -77,7 +84,7 @@ namespace DockerFileBuildHelper
mightBeUnavailable = true;
}
if (info.DockerFilePathARM32v7 != null)
{
{
var dockerFile = DockerFile.Parse(info.DockerFilePathARM32v7);
builder.AppendLine($"# {info.GetGithubLinkOf(dockerFile.DockerFullPath)}");
builder.AppendLine($"[[ \"$(uname -m)\" == \"armv7l\" ]] && DOCKERFILE=\"{dockerFile.DockerFullPath}\"");
@ -88,7 +95,7 @@ namespace DockerFileBuildHelper
builder.AppendLine($"# {info.GetGithubLinkOf(dockerFile.DockerFullPath)}");
builder.AppendLine($"[[ \"$(uname -m)\" == \"aarch64\" ]] && DOCKERFILE=\"{dockerFile.DockerFullPath}\"");
}
if(mightBeUnavailable)
if (mightBeUnavailable)
{
builder.AppendLine($"if [[ \"$DOCKERFILE\" ]]; then");
builder.Indent++;
@ -109,12 +116,83 @@ namespace DockerFileBuildHelper
builder.AppendLine();
}
var script = builder.ToString().Replace("\r\n", "\n");
if (string.IsNullOrEmpty(outputFile))
outputFile = "build-all.sh";
File.WriteAllText(outputFile, script);
Console.WriteLine($"Generated file \"{Path.GetFullPath(outputFile)}\"");
if (string.IsNullOrEmpty(options.BuildAllScriptOutput))
options.BuildAllScriptOutput = "build-all.sh";
File.WriteAllText(options.BuildAllScriptOutput, script);
Console.WriteLine($"Generated file \"{Path.GetFullPath(options.BuildAllScriptOutput)}\"");
if (!string.IsNullOrEmpty(options.READMEOutput))
{
var readme = File.ReadAllText(options.READMEOutput);
var start = readme.IndexOf("| Source |");
var end = start;
for (; end < readme.Length; end++)
{
if (readme[end] == '\r' && readme[end + 1] == '\n' && readme[end + 2] != '|')
{
end += 2;
break;
}
if (readme[end] == '\n' && readme[end + 1] != '|')
{
end += 1;
break;
}
}
StringBuilder tb = new StringBuilder();
tb.Append(readme.Substring(0, start));
tb.AppendLine("| Source | Image | Version | x64 | arm32v7 | links |");
tb.AppendLine("|---|---|---|:-:|:-:|:-:|");
dockerInfos = dockerInfos.OrderBy(i => i.Image.Source).ToList();
// Make sure bitcoin appears before shitcoin
PushToEnd(2, dockerInfos);
PushToEnd(2, dockerInfos);
PushToEnd(7, dockerInfos);
PushToEnd(7, dockerInfos);
foreach (var image in dockerInfos)
{
string source = "*";
if (image.Image.Source != null)
{
source = Path.GetFileName(image.Image.Source);
}
tb.Append($"| {source} | {image.Image.ToString(false)} | {image.Image.Tag} |");
if (!string.IsNullOrEmpty(image.DockerFilePath))
{
tb.Append($" [✔️]({image.GetGithubLinkOf(image.DockerFilePath)}) |");
}
else
{
tb.Append($" ️❌ |");
}
if (!string.IsNullOrEmpty(image.DockerFilePathARM32v7))
{
tb.Append($" [✔️]({image.GetGithubLinkOf(image.DockerFilePathARM32v7)}) |");
}
else
{
tb.Append($" ️❌ |");
}
tb.AppendLine($" [Github]({image.GitLink}) - [DockerHub]({image.DockerHubLink}) |");
}
tb.Append(readme.Substring(end));
File.WriteAllText(options.READMEOutput, tb.ToString());
}
return true;
}
private void PushToEnd(int index, List<DockerInfo> dockerInfos)
{
var temp = dockerInfos[index];
dockerInfos.RemoveAt(index);
dockerInfos.Add(temp);
}
HttpClient client = new HttpClient();
private async Task<bool> CheckLink(DockerInfo info, string path)
{
@ -122,7 +200,7 @@ namespace DockerFileBuildHelper
return true;
var link = info.GetGithubLinkOf(path);
var resp = await client.GetAsync(link);
if(!resp.IsSuccessStatusCode)
if (!resp.IsSuccessStatusCode)
{
Console.WriteLine($"\tBroken link detected for image {info.Image} ({link})");
return false;
@ -145,6 +223,7 @@ namespace DockerFileBuildHelper
if (imageStr == null)
continue;
var image = Image.Parse(imageStr.ToString());
image.Source = file;
yield return image;
}
}
@ -154,7 +233,7 @@ namespace DockerFileBuildHelper
DockerInfo dockerInfo = new DockerInfo();
var name = $"{image.User}/{image.Name}";
bool firstTry = true;
retry:
retry:
switch (name)
{
case "btglnd":

2
contrib/DockerFileBuildHelper/update-repo.ps1

@ -1 +1 @@
dotnet run --no-launch-profile -c Release -- -o "../build-all-images.sh"
dotnet run --no-launch-profile -c Release -- -o "../build-all-images.sh" -omd "../../README.md"

2
contrib/DockerFileBuildHelper/update-repo.sh

@ -1,3 +1,3 @@
#!/bin/bash
dotnet run --no-launch-profile -c Release -- -o "../build-all-images.sh"
dotnet run --no-launch-profile -c Release -- -o "../build-all-images.sh" -omd "../../README.md"
Loading…
Cancel
Save