Using service network alias outside of compose

My compose file creates a custom named bridge network ‘bob-net’ and brings up the '‘joe’ service on ‘bob-net’ so that other services on ‘bob-net’ can access the service at http://joe:12648. Outside of the compose file I create a container named ‘fred’ and attach it to ‘bob-net’. How can I get fred to access joe via the service alias http://joe:12648? I seem to only be able to have fred access joe via IP address, not via alias, and I’d like to use the alias for clarity and in case bringing things up & down changes the IP.