diff --git a/.drone.yml b/.drone.yml index 5689061..a878593 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,16 +29,15 @@ steps: commands: - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - - name: docker build and push - image: docker:20.10 - privileged: true + - name: build and push + image: gcr.io/kaniko-project/executor:latest environment: - DOCKER_USERNAME: - from_secret: docker_username - DOCKER_PASSWORD: - from_secret: docker_password + DOCKER_CONFIG: /drone/src/.docker commands: - - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - - docker build -t khwezi/webapitest:latest -t khwezi/webapitest:${DRONE_BUILD_NUMBER} . - - docker push khwezi/webapitest:latest - - docker push khwezi/webapitest:${DRONE_BUILD_NUMBER} \ No newline at end of file + - mkdir -p /drone/src/.docker + - echo $DOCKER_CONFIG_SECRET > /drone/src/.docker/config.json + - /kaniko/executor + --context=. + --dockerfile=Dockerfile + --destination=index.docker.io/khwezi/webapitest:${DRONE_BUILD_NUMBER} + --destination=index.docker.io/khwezi/webapitest:latest \ No newline at end of file