我正在获取 phusion/baseimage 并在 wercker.yml 文件的“构建”管道中更新它,但在“部署”管道中推送到我的注册表的图像似乎不是“phusion/baseimage”的更新版本,我我正在安装 Java、nginx 等,但容器图像不一样。请帮忙!我很困惑,因为我错过了一步。这是我的 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
我的场景很简单:我需要创建一个以“phusion/baseimage”为基础的 docker 映像并更新我的注册表,然后自动执行 ecs 任务定义更新并运行该任务。