TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Run the TRIGGERcmd linux agent in a Docker container

    Scheduled Pinned Locked Moved Linux
    1 Posts 1 Posters 1.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR Offline
      Russ
      last edited by Russ

      Docker provides a quick and easy way to package and run Linux software. This also works on Windows if you run Docker on Windows.

      Here's how to build and run a Docker container that runs the TRIGGERcmd agent:

      Create a text file called Dockerfile with these contents:

      FROM ubuntu
      
      ENV DEBIAN_FRONTEND=noninteractive 
      RUN apt-get -y update && apt-get -y upgrade
      RUN apt install -y nodejs npm wget
      RUN wget https://s3.amazonaws.com/triggercmdagents/triggercmdagent_1.0.1_amd64.deb
      RUN apt install -y ./triggercmdagent_1.0.1_amd64.deb
      
      CMD node /usr/lib/triggercmdagent/resources/app/src/agent.js --console
      

      To build the container image, cd to the directory where you put the Dockerfile file, then run this command:

      docker build . --tag=triggercmdagent
      

      To see your new Docker image in your local Docker cache, run this command:

      docker images
      

      To run your new image on Linux and use /tmp as your TRIGGERcmd data folder, run:

      docker run -it -v /tmp:/root/.TRIGGERcmdData triggercmdagent
      

      To run your new image on Windows and use c:\mydir as your TRIGGERcmd data folder, run:

      docker run -it -v c:\mydir:/root/.TRIGGERcmdData triggercmdagent
      

      When you run it, you'll see it prompt for your token (from the Instructions page):

      Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
      Daemon install: false
      No token exists.  Login to request one.
      prompt: token:
      

      EDIT 3/28/21: I improved the docker container and published the code here:
      https://github.com/rvmey/docker-triggercmdagent

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • tuicemenT tuicemen moved this topic from Instructions on

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post