Skip to content

Commit

Permalink
Bug fixes for Docker on Linux (#2)
Browse files Browse the repository at this point in the history
- Dockerfile updates to map `bamboo` group to host `docker` group
- Custom logo added, pending actual customization
  • Loading branch information
mblomdahl committed Sep 26, 2022
1 parent 8080928 commit 18bf22e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .env-template
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ PROXY_PORT=443
PROXY_SCHEME=https
PROXY_SECURE=true

# Bamboo (change user/group to root to enable Docker support locally on MacOS)
# Bamboo (change user to root to enable Docker support locally on MacOS)
BAMBOO_USER=bamboo
BAMBOO_GROUP=bamboo
BAMBOO_HOSTNAME=bamboo_server
BAMBOO_PORT=8085
BAMBOO_HOST_DOCKER_GID=995
BAMBOO_HOST_DOCKER_SOCKET=/var/run/docker.sock
BAMBOO_SECURITY_TOKEN=myPasswordsAreLeaking
BAMBOO_LICENSE=AAABpQ0ODAoPeNqFkt...6gl+2nK07zqsQ==X02kc
Expand Down
15 changes: 11 additions & 4 deletions bamboo_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

RUN apt-get update && apt-get install --yes docker-ce-cli docker-ce docker-compose

# Allow unprivileged `bamboo` user to interact with Docker engine
RUN usermod -aG docker bamboo
RUN apt-get update && apt-get install --yes docker-ce-cli docker-compose

# Python development
RUN apt-get install --yes python3-venv python3-pandas python3-sqlalchemy libmysqlclient-dev ipython3
Expand All @@ -31,3 +28,13 @@ RUN apt-get install --yes openjdk-8-jdk openjdk-11-jdk gradle scala kotlin

# Ruby and Provisioning/CD
RUN apt-get install --yes ruby rubygems ansible awscli

# Allow unprivileged `bamboo` user to interact with Docker engine
ARG DOCKER_GID=2005
RUN groupmod -g $DOCKER_GID bamboo

# Add custom logo
ADD attachments /var/atlassian/application-data/bamboo/shared/attachments

# Chown Bamboo home directory
RUN chown -vR bamboo:bamboo /var/atlassian/application-data/bamboo/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bamboo_server/attachments/logos/bamboo-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ services:

bamboo_server:
image: bamboo_server
build: ./bamboo_server
build:
context: ./bamboo_server
args:
- DOCKER_GID=${BAMBOO_HOST_DOCKER_GID}
container_name: bamboo_server
healthcheck:
test: [ "CMD", "curl", "-s", "http://localhost:${BAMBOO_PORT}/rest/api/latest/status" ]
timeout: 5s
interval: 30s
retries: 3
retries: 6
restart: unless-stopped
depends_on:
- postgresql_server
Expand All @@ -50,7 +53,8 @@ services:
protocol: tcp
mode: host
environment:
# https://bitbucket.org/atlassian-docker/docker-bamboo-server/src/master/entrypoint.py
# https://bitbucket.org/atlassian-docker/docker-bamboo-server/src/master/entrypoint.py and
# https://bitbucket.org/atlassian-docker/docker-shared-components/src/master/image/entrypoint_helpers.py
- RUN_USER=${BAMBOO_USER}
- RUN_GROUP=${BAMBOO_GROUP}
- ATL_PROXY_NAME=${PROXY_HOSTNAME}
Expand Down Expand Up @@ -85,7 +89,6 @@ services:
- ATL_JDBC_USER=${DB_USER}
- ATL_JDBC_PASSWORD=${DB_PASSWORD}
volumes:
#- ${PWD}/bamboo_data:/var/atlassian/application/application-data/bamboo:rw
- /var/run/docker.sock:${BAMBOO_HOST_DOCKER_SOCKET}
- ${PWD}/bamboo_home:/var/atlassian/application-data/bamboo:rw

Expand Down

0 comments on commit 18bf22e

Please sign in to comment.