﻿# Sample Dockerfile for the AppDynamics Standalone Machine Agent
# This is provided for illustration purposes only, for full details
# please consult the product documentation: https://docs.appdynamics.com/

FROM ubuntu:16.04

# Install required packages
RUN apt-get update && \
    apt-get install -y unzip && \
    apt-get clean

# Install AppDynamics Machine Agent
ENV MACHINE_AGENT_HOME /opt/appdynamics/machine-agent/
ENV LOGS_DIRECTORY logs
ADD machine-agent.zip /tmp/machine-agent.zip
RUN mkdir -p ${MACHINE_AGENT_HOME} && \
    unzip -oq /tmp/machine-agent.zip -d ${MACHINE_AGENT_HOME} && \
    rm /tmp/machine-agent.zip

RUN useradd -m -s /bin/bash appdynamics

# Include start script to configure and start MA at runtime
ADD start-appdynamics ${MACHINE_AGENT_HOME}
RUN chmod 744 ${MACHINE_AGENT_HOME}/start-appdynamics

# Changing directory to MACHINE AGENT HOME
WORKDIR ${MACHINE_AGENT_HOME}

USER appdynamics
# Configure and Run AppDynamics Machine Agent
CMD "./start-appdynamics"