0

I'm trying to run the below composefile on centos7:

version: "3.3"
services:

  bitbucket:
    image: atlassian/bitbucket:latest
    ports:
      - 7990:7990
      - 7999:7999
    networks:
      - my-app-net
networks:
  my-app-net:
    driver: bridge

But it fails to install it. I took the info from here: https://hub.docker.com/r/atlassian/bitbucket-server/ did someone manage to install it as a container on Centos?

2
  • First of all, what you posted is a Compose file, not a Dockerfile. Second, what do you mean through Vagrant? Vagrant cannot use a Compose file by itself. Post some more details, including Vagrantfile and any errors, please. Aug 3 '20 at 21:44
  • I clarified the question. Vagrant has nothing to do with it, so you can ignore it. the error I'm getting is image does not exist
    – arielma
    Aug 4 '20 at 3:50
1

Since I do not currently have access to a server with Centos installed, I tested my soultion on Ubuntu 20.04. That being said, the whole point of using Docker is to make applications distribution-agnostic, so it should work on Centos as well.

You're getting an image does not exist error, because the image you specified does not, in fact, exist. There is a typo in one line of the README file provided on Docker Hub and you happened to use that line when writing your Compose file.

That being said, incorect image name is not your only issue. You have not specified a volume for your Bitbucket installation, meaning all of your data will be lost if the container is destroyed. Furthermore, the only way to backup a dockerized Bitbucket installation is to use method described here, which requires using external database.

With that in mind the minimal Compose file for Bitbucket is:

version: '3.3'
services:
  bitbucket:
    hostname: bitbucket
    image: atlassian/bitbucket-server:latest
    environment:
     - JDBC_DRIVER=org.postgresql.Driver
     - JDBC_USER=bitbucketuser
     - JDBC_PASSWORD=jellyfish
     - JDBC_URL=jdbc:postgresql://db:5432/bitbucket
    volumes:
      - bitbucket_data:/var/atlassian/application-data/bitbucket
    ports:
      - 7990:7990
      - 7999:7999
    depends_on:
      - db
  db:
    hostname: db
    image: postgres:11.2-alpine
    command: -c 'max_prepared_transactions=64'
    environment:
     - POSTGRES_USER=bitbucketuser
     - POSTGRES_PASSWORD=jellyfish
     - POSTGRES_DB=bitbucket
    volumes:
     - db_data:/var/lib/postgresql/data  
volumes:
  bitbucket_data:
  db_data:

That can be further extended with httpd or nginx service used as a reverse proxy, which could also be used to enable HTTPS connections to your Bitbucket instance and an Elasticsearch service to replace the embedded one as well as an email server for Bitbucket to use to send various notifications to users.

I would definitely recommend the SSL-enabled reverse proxy and email server for production. Elasticsearch server is only necessary if you want to run Bitbucket cluster rather than a single instance.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.