0

I am taking the phusion/baseimage and updating it in 'build' pipeline in wercker.yml file but the image being pushed to my registry in 'deploy' pipeline doesn't seems to be the updated version of 'phusion/baseimage', i am installing Java, nginx etc but the conatiner image does'nt have the same. Please help! I am confused as where i am missing a step. Here is my wercker.yml:

>

     box: phusion/baseimage no-response-timeout: 15
    > 
    > build:
    >     steps:
    >       - script:
    >           name: Install packages
    >           code: |
    >             apt-get update && apt-get upgrade -y
    >             echo "install unzip"  
    >             apt-get install unzip -y
    >             echo "install nginx"
    >             apt-get install nginx -y
    >             apt-get install telnet -y
    >             service nginx stop
    >             apt-get install python2.7 -y
    >             apt-get install python-pip -y
    >             pip install awscli
    >       - script:
    >           name: Oracal Java Installation
    >           code: |
    >             apt-get install software-properties-common -y
    >             add-apt-repository ppa:webupd8team/java -y
    >             apt-get update
    >             echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
    >             apt-get install oracle-java8-installer -y
    >       - script:
    >           name: Jetty Installation
    >           code: |
    >             groupadd -r jetty && useradd -r -g jetty jetty
    >             JETTY_HOME=/usr/local/jetty
    >             PATH=$JETTY_HOME/bin:$PATH
    >             mkdir -p "$JETTY_HOME"
    >             cd /usr/local/jetty
    >             gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B59B67FD7904984367F931800818D9D68FB67BAC
    >             gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 5DE533CB43DAF8BC3E372283E7AE839CD7C58886
    >             curl -SL <jetty.tar.gz>
    > -o jetty.tar.gz
    >             curl -SL <jetty.tar.gz>
    > -o jetty.tar.gz.asc
    >             gpg --verify jetty.tar.gz.asc
    >             tar -xvf jetty.tar.gz --strip-components=1
    >             sed -i '/jetty-logging/d' etc/jetty.conf
    >             rm -fr demo-base javadoc
    >             rm jetty.tar.gz*
    >       - script: 
    >          name: Jetty Configuration
    >          code: |
    >            JETTY_BASE=/var/lib/jetty
    >            mkdir -p "$JETTY_BASE"
    >            cd /var/lib/jetty
    >            modules="$(grep -- ^--module= "$JETTY_HOME/start.ini" | cut -d= -f2 | paste -d, -s)"
    >            java -jar "$JETTY_HOME/start.jar" --add-to-startd="$modules,setuid"
    >       - script:
    >          name: Jetty RUN
    >          code: |
    >            JETTY_RUN=/run/jetty
    >            JETTY_STATE=$JETTY_RUN/jetty.state
    >            TMPDIR=/tmp/jetty
    >            mkdir -p "$JETTY_RUN" "$TMPDIR"
    >            chown -R jetty:jetty "$JETTY_RUN" "$TMPDIR" "$JETTY_BASE"
    >            mkdir /etc/service/jetty
    >            cp -r start_jetty.sh /etc/service/jetty/run
    >            chmod a+x /etc/service/jetty/run deploy:   box: python:2.7-slim   dockerhub:
    >   - pip-install
    >   - internal/docker-push:
    >       username: $USERNAME
    >       password: $PASSWORD
    >       tag: latest
    >       repository: shantanup/wercker
    >       registry: https://registry.hub.docker.com   aws-ecs:
    >   - script:
    >       name: copy
    >       code: mkdir /app && cp wercker-app.json /app/
    >   - tonnu/aws-ecs:
    >       key: $AWS_ACCESS_KEY
    >       secret: $AWS_SECRET_KEY
    >       region: us-east-1
    >       cluster-name: wrecker-cluster
    >       service-name: wercker
    >       task-definition-name: wercker-task
    >       task-definition-file: /app/wercker-app.json
    >       minimum-running-tasks: 1

My scenario is simple : I need to create a docker image with 'phusion/baseimage' as base and update my registry and then automate the ecs task definition update and run the task.

Hussain K
  • 613
  • 8
  • 16

1 Answers1

0

seems like you're missing some docker and wercker knowhow. Wercker is mainly used as a continuous integration server, thus in charge of compiling, executing tests and deploying the successful builds. It is not used to prepare the base image like you are trying to do.
Now docker on the other hand is used just for that. So you simply need to create a docker image of your own. Create a Dockerfile that is based on phusion/baseimage and install all the missing layers (nginx, telnet, etc.). Once you're happy with the image you prepared, you can push it to Dockerhub or any other docker repository. Then you'd tell wercker to use your own image for the build phase.

Another key piece of information - wercker will use all the steps you give him, but will not push the created build box as it is considered dirty. instead it will take whatever is in the $WERCKER_SOURCE_DIR folder. so anything else you created during build will not be included.

Tal
  • 7,827
  • 6
  • 38
  • 61