Problem so far I’ve got is that I can’t get the IPv6 address of the instance within my custom entrypoint
# entrypoint.sh
#!/bin/bash
echo "-------------------------"
echo "-------------------------"
echo "-------------------------"
echo "-------------------------"
echo "RUNNING CUSTOM ENTRYPOINT entrypoint.sh"
export ERL_FLAGS="-proto_dist inet6_tcp"
echo "ERL_FLAGS $ERL_FLAGS"
export INTERNAL_ADDR="$FLY_ALLOC_ID.vm.$FLY_APP_NAME.internal"
echo "INTERNAL_ADDR: $INTERNAL_ADDR"
dig +short aaaa "$INTERNAL_ADDR" @fdaa::3
echo $(dig +short aaaa "$INTERNAL_ADDR" @fdaa::3)
ping -6 $INTERNAL_ADDR
echo $(ping -6 $INTERNAL_ADDR)
ping -6 "$FLY_ALLOC_ID.vm.$FLY_APP_NAME.internal"
export NODENAME=$(dig +short aaaa "$INTERNAL_ADDR" @fdaa::3)
echo $NODENAME
export NODENAME=$INTERNAL_ADDR
echo "-------------------------"
echo "-------------------------"
echo "-------------------------"
echo "-------------------------"
# original entrypoint and cmd
tini -- /docker-entrypoint.sh /opt/couchdb/bin/couchdb
A little chaotic I know, just debugging trying to make it visually more outstanding, especially as CouchDB starts its error log madness about _users db not existent until you create it (that’s expected, tho pretty annoying trying to debugging via the log😅)
# Dockerfile
FROM apache/couchdb:3.2.2
COPY local.ini /opt/couchdb/etc/
COPY entrypoint.sh /usr/local/bin/
RUN apt-get update && apt-get install -y -q nano dnsutils iputils-ping
ENTRYPOINT ["/bin/sh","-c"]
CMD ["/usr/local/bin/entrypoint.sh"]
trying
export INTERNAL_ADDR="$FLY_ALLOC_ID.vm.$FLY_APP_NAME.internal"
ping -6 $INTERNAL_ADDR
results in
ping: 06d8fc4b-d779-2f0c-6b92-919f68352364.vm.crcouchdb1.internal: Name or service not known
Just to be sure also tried ping $INTERNAL_ADDR without -6 with the same result
and
echo $(dig +short aaaa "$INTERNAL_ADDR" @fdaa::3)
just prints nothing ![]()
Just in case tried the hostname export NODENAME=$INTERNAL_ADDR because that’s all I had available so far which results in CouchDB Fauxton UI trying to add a second node
{conn_failed,{error,nxdomain}}
What am I doing wrong why can’t I get the IPv6 of the instace via dig or ping like this?
By the way followed this comment on GitHub which suggests it might work, following the steps and as mentioned tried hostname as suggested there ![]()
Also I’m not using WireGuard, just to make sure we’re on the same boat and because last time I could query the IPv6 from my Deno app I gave it a shot and made a Deno compiled entrypoint.
const FLY_ALLOC_ID = Deno.env.get("FLY_ALLOC_ID")
const FLY_APP_NAME = Deno.env.get("FLY_APP_NAME")
const internalAddress = `${FLY_ALLOC_ID}.vm.${FLY_APP_NAME}.internal`
console.log(await Deno.resolveDns(internalAddress, "AAAA"))
// result
// error: Uncaught (in promise) NotFound: no record found for name:
// 28aa063f-2614-14f9-9684-11bd8c05f82a.vm.crcouchdb1.internal. type: AAAA class: IN