Created
December 8, 2022 14:14
-
-
Save IsaacHatilima/8a47bd6bea30aae497dee306032c5fed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- step: | |
name: | |
Push To Docker Hub | |
services: | |
- docker | |
script: | |
- docker logout | |
#Authenticate on Docker | |
#The below says Error: Cannot perform an interactive login from a non TTY device | |
- docker login --username $DOCKER_HUB_USERNAME --password-stdin $DOCKER_HUB_PASSWORD | |
#The below says invalid username or password | |
# - echo $DOCKER_HUB_PASSWORD | docker login --username $DOCKER_HUB_USERNAME --password-stdin | |
#Build Docker Image | |
- docker build -t myticket.azurecr.io/myticket . | |
#Push to Docker Hub | |
- docker push isaachats/myticket:latest |
Try this let's see
Format it to pattern of a yaml file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pipelines: default: - step: name: Build and push Docker image image: docker:18.09.7 script: - docker build -t my-image . - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - docker push my-image
the docker command is being used to build a Docker image named my-image from the Dockerfile in the root of the repository. The docker login command is then used to log in to the Docker registry using the DOCKER_USERNAME and DOCKER_PASSWORD environment variables, which you will need to set up in the Bitbucket settings for your repository. Finally, the docker push command is used to push the built image to the Docker registry.