Dockerfile for build images take 2 parameters SBT_VERSION (default 1.3.8) NODE_VERSION (derfault 10.15.1)
FROM adoptopenjdk:11.0.4_11-jdk-hotspot
ARG NODE_VERSION=10.15.1
ARG UNAME=bamboo
ARG GNAME=bamboo
ARG UID=109
ARG GID=115
SHELL ["/bin/bash", "-c"]
RUN apt-get update
RUN apt-get install sudo
RUN groupadd --gid $GID $GNAME
RUN adduser --uid $UID --ingroup $GNAME --gecos "" --disabled-password --home /opt/bamboo --shell /bin/bash $UNAME
RUN usermod -aG sudo $UNAME
RUN echo "$UNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN apt-get -y install apt-transport-https ca-certificates gnupg-agent software-properties-common
#Install sbt
RUN echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list && \
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add && \
apt-get update && \
apt-get -y install sbt
# Install git
RUN apt-get -y install git
# Install docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update
RUN apt-get -y install docker-ce docker-ce-cli containerd.io
# Install docker compose
RUN curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose
## From here on run commands as user
USER $UNAME
# Init sbt
RUN cd && sbt sbtVersion
RUN rm -rf ~/project && rm -rf ~/target
# Install nvm and node
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
source ~/.nvm/nvm.sh && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION
COPY ./fbrd-master-branch /usr/local/bin/fbrd-master-branch
RUN sudo chmod 777 /usr/local/bin/fbrd-master-branch
COPY ./build-setup /usr/local/bin/build-setup
RUN sudo chmod 777 /usr/local/bin/build-setup
ENV NVM_DIR ~/.nvm
ENV NODE_DIR /opt/bamboo/.nvm/versions/node/v$NODE_VERSION/
ENV PATH $NODE_DIR/bin:$PATH
ENV NODE_PATH $NODE_DIR/lib/node_modules
Content type
Image
Digest
Size
720.7 MB
Last updated
almost 6 years ago
docker pull firstbird/build:sbt-latest_node10.15.1