You'll need a PAT with package write
permissions
Then:
echo $GIT_PAT | docker login ghcr.io -u yourgithubuser --password-stdin
docker push ghcr.io/yourgithubuser/somepackaganame:latest
Note: somepackagename is just an arbitrary name for your container. I like to name mine the same as the linked repo. However, the naming doesn't automatically link it the the repo where your Dockerfile and code are.. Thats the next step
github considers a docker container as a package
Since this is your first push of the container, github doesnt know which repo to use
Go to User Profile in upper left, then note the Packages
tab that ats the top of your profile.
When you click that you will be taken to your Package settings.
You can also try:
https://github.com/yourgithubuser?tab=packages
You can then select the package, change its visibility if desired, and link it to code.