repository not building when connected to bitbucker server on drone - drone.io

Im trying drone 0.5 with bitbucket server,
And it seems connected because i can see my repositories.
But it keeps saying that it does not have any builds yet.
I added the drone.yml to my repo but nothing... am i missing something

I noticed that you said you:
I added the drone.yml to my repo
however that would be problematic because you have to add a:
.drone.yml
note that the correct file has a "." in front of it.
Additionally you should be trying to manually type in the authorization url to give drone access to your bitbucket account (ps drone wont work without some kind of scm set up) an example of the authorization url would be:
https://my.exampleurl.com/authorize
These are similar to the same instructions you can find here: http://readme.drone.io/admin/installation-guide/
I often see people post links like this and then someone will ask them to have copied the link's content into the actual response so I am going to do that here (you know just in case the link flys away):
Drone is distributed as a single binary file inside a scratch Docker image. Docker is the only dependency. This guide demonstrates how to install Drone using docker-compose.
Example Docker compose file with GitHub integration:
version: '2'
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker
- DRONE_SECRET=${DRONE_SECRET}
Drone integrates with multiple version control providers, configured using environment variables. This example demonstrates basic GitHub integration.
You will need to register Drone with GitHub to obtain an oauth2 client and secret. The authorization callback url should match :///authorize
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
+ - DRONE_GITHUB=true
+ - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
+ - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
Drone mounts a volume on the host machine to persist the sqlite database. This is not required when using alternate database engines.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
+ volumes: [ ./drone:/var/lib/drone/ ]
restart: always
Drone agents require access to the host machine Docker daemon.
services:
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
+ volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
Drone agents require the server address for agent-to-server communication.
Your server URL should use the wss:// protocol when TLS is enabled
services:
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
+ DRONE_SERVER=ws://drone-server:8000/ws/broker
DRONE_SECRET=${DRONE_SECRET}
Drone server and agents use a shared secret to authenticate communication. This should be a random string of your choosing and should be kept private.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
- DRONE_OPEN=true
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
+ - DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes: [ /var/run/docker.sock:/var/run/docker.sock ]
environment:
DRONE_SERVER=ws://drone-server:8000/ws/broker
+ DRONE_SECRET=${DRONE_SECRET}
Drone registration is closed by default. This example enables open registration for users that are members of approved GitHub organizations.
services:
drone-server:
image: drone/drone:0.5
ports: [ 80:8000 ]
volumes: [ ./drone:/var/lib/drone/ ]
restart: always
environment:
+ - DRONE_OPEN=true
+ - DRONE_ORGS=dolores,dogpatch
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}

Related

Openldap setup with server and UI fails

I'm trying to setup open ldap in linux VM and I am using openldap server from bitnami and
also the UI container. My docker-compose file is as follows:
version: '3'
networks:
openldap:
name: openldap
services:
openldap:
image: bitnami/openldap:latest
restart: unless-stopped
ports:
- '1389:1389'
- '1636:1636'
environment:
- LDAP_ORGANISATION=company
- LDAP_DOMAIN=company.network
- LDAP_ROOT=dc=company,dc=network
- LDAP_ADMIN_USERNAME=admin
- LDAP_ADMIN_PASSWORD=password
networks:
- openldap
volumes:
- 'openldap_data:/bitnami/openldap'
openldap-ui:
image: wheelybird/ldap-user-manager:latest
restart: unless-stopped
ports:
- 8082:80
environment:
- SERVER_HOSTNAME=localhost:8082
- LDAP_URI=ldap://openldap
- LDAP_BASE_DN=dc=company,dc=network
- LDAP_ADMINS_GROUP=admins
- LDAP_ADMIN_BIND_DN=cn=admin,dc=company,dc=network
- LDAP_ADMIN_BIND_PWD=password
- LDAP_IGNORE_CERT_ERRORS=true
- NO_HTTPS=true
networks:
- openldap
depends_on:
- openldap
volumes:
openldap_data:
driver: local
As per this documentation, when i try to do the initial setup via UI (http://ip-address:8082/setup), using the password 'password', I always get the following error.
Problem: Failed to bind as cn=admin,dc=company,dc=network
Wondering if anyone help identify what'm missing here?

Why can I not use the traefik.yml with the docker provider?

I have the following instances of containers and all routing through Traefik as expected;
version: '3.3'
services:
website:
container_name: my-next-js-website
build:
context: .
dockerfile: Dockerfile.dev
ports:
- '3000:3000'
volumes:
- .:/srv
labels:
- traefik.http.routers.website.rule=Host(`domain.local`)
- traefik.enable=true
- traefik.port=3000
traefik:
image: traefik:v2.3
command:
- --entrypoints.web.address=:80
- --providers.docker
- --api
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- traefik.http.routers.traefik.rule=Host(`traefik.domain.local`)
- traefik.http.routers.traefik.service=api#internal
- traefik.http.routers.traefik.middlewares=auth
- traefik.http.middlewares.auth.basicauth.usersfile=/path/to/userList
ports:
- '80:80'
Up until this point, it's all good.
My question is when I add $PWD/traefik.yml:/etc/traefik/traefik.yml as a volume and move the labels into this traefik.yml config, why does it not work in the same way (as in the basic auth is missing)?
What I'm trying to add is basic auth to Traefik so it's inaccessible but I can only do so via docker labels and not via traefik.yml - please, I would like to understand what I am doing incorrect or if I am missing something?
I've looked through the Traefik documentation with no luck and spent about 6 hours playing around with it... Do Docker labels and commands work better than the config file to set basic auth around Traefik's API and dashboard?

Java Application on Docker (MySQL + Rabbit)

I am making an REST API which has a POST method which accepts a String as JSON and then sends it over RabbitMQ Topic and then a consumer is converting into entity and saving into a MySQL db.
Everything is running fine locally, but my task is to upload it on Docker and to be run online.
When I try to change "localhost" in properties with container names my Maven build fails....
How can i fix that?
I am putting my .properties:
spring.main.allow-bean-definition-overriding=true
spring.datasource.url=jdbc:mysql://localhost:3306/rabbit_messages?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=1234
spring.rabbitmq.host = 127.0.0.1
spring.rabbitmq.port = 5672
spring.rabbitmq.username = guest
spring.rabbitmq.password = guest
and my docker-compose:
version: '3'
services:
my-app:
container_name: myapp
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
links:
- rabbitmq
- mysql
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3307/rabbit_messages?createDatabaseIfNotExist=true
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=1234
- SPRING_RABBITMQ_HOST=rabbitmq
depends_on:
- rabbitmq
- mysql
java:
image: openjdk:latest
container_name: openjdk
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
erlang:
image: erlang:latest
container_name: erlang
mysql:
image: mysql:latest
container_name: mysql
ports:
- "3307:3307"
environment:
- MYSQL_DATABASE=rabbit_messages
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_PASSWORD=1234
restart: on-failure

Docker DNS multiple containers with apache vhosts (wildcard domain)

For the company I work at, I setup a docker environment using docker-composer and multiple containers so we can all benefit from having the same environment. I created a subdomain DNS record (dev.company.com) pointing to 127.0.0.1. This works fine for reaching projects from within the browser to the appropriate Apache vhosts. The problem however is that we cannot resolve this domain within the PHP container because the DNS points towards 127.0.0.1 how can I add a custom entry to the docker php container to resolve *.dev.company.com to the Apache container?
Also adding this to /etc/hosts is not really an option because we run like 50+ projects.
I found some solutions online which just said to add php to the same container, but this kinda defeats the purpose of having separate containers per service. Added docker-composer file as reference.
Note: I'm the only one using Linux in the office other colleagues are using Docker on Windows or Mac, so a Linux only solution won't cut it :)
version: "3.7"
services:
php:
build: php
env_file:
- ./conf/php.config.env
volumes:
- ./htdocs:/htdocs
expose:
- "9000"
links:
- mysql
- mssql
- mail
restart: always
init: true
apache:
build: apache
volumes:
- ./htdocs:/htdocs:ro
ports:
- "80:80"
- "443:443"
links:
- php
restart: always
init: true
mysql:
build: mysql
env_file:
- ./conf/mysql.config.env
volumes:
- ./mysql/data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
mssql:
image: microsoft/mssql-server-linux
env_file:
- ./conf/mssql.config.env
volumes:
- ./mssql/data:/var/opt/mssql/data
ports:
- "1433:1433"
restart: always
mail:
image: schickling/mailcatcher
ports:
- "1080:1080"
restart: always
init: true
redis:
image: redis
expose:
- "6379"
links:
- php
restart: always
init: true

How can i use traefik2.0 in docker swarm, i don't know which labels ishould use

I want use traefik2.0 publish port 80 and 7000, the port 7000 is for frp(TCP). Now i am testing locally with 2.0 doc, i am using example on quick start but not running.
This is my docker compose file.
version: '3'
services:
reverse-proxy:
image: traefik:v2.0 # The official v2.0 Traefik docker image
command:
- "--api"
- "--entrypoints='Name:http Address::80'"
- "--providers.docker" # Enables the web UI and tells Traefik to listen to docker
- "--providers.docker.swarmmode=true"
- "--providers.docker.watch=true"
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
networks:
- traefik-net
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
whoami:
image: containous/whoami # A container that exposes an API to show its IP address
networks:
- traefik-net
deploy:
labels:
- "traefik.http.routers.whoami.tls=true"
- "traefik.http.routers.whoami.entrypoints=https"
- "traefik.http.routers.whoami.rule=Host(`whoami.domain.com`)"
- "traefik.http.middlewares.whoami.redirectscheme.scheme=https"
networks:
traefik-net:
external: true
i expect which labels used on traefik2.0 can work
You're almost there!
Replace
- "--entrypoints='Name:http Address::80'"
with
- "--entryPoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
Enable the dashboard in a non-production environment. You'll also need to replace
- "--api" with
- "--api.insecure=true"
One of the labels of whoami has a mistake. There is no https entrypoint, it's now called websecure. So change
- "traefik.http.routers.whoami.entrypoints=https"
with
- "traefik.http.routers.whoami.entrypoints=websecure"
And finally expose the internal port that the whoami app is running on.
By adding this to the label of whoami
- traefik.http.services.whoami-service.loadbalancer.server.port=80
You should be able to verify it using the traefik dashboard on localhost:8080