Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

why docker inside the bitbucket docker pipeline?


I am trying to build a nodejs angular docker image and run a container of it in AWS ECS. I think this way of doing it is very ineffecient and illogical. But I don´t know how to it in another way.


Here I use a node image with aws cli to easily push the and deploy the docker image to a aws ecs container


image: rhinogram/node-awscli
#image: node:9.7.1

docker: true

- step:
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'."
- step:
- docker

- eval $(aws ecr get-login --no-include-email | sed 's|https://||')

- cd ./ClientApp/
- docker build -t xxx .

# Tag and push my docker image to ECR
- docker tag xxx
- docker push xxx

# Register the ECS task definition and capture the version
- export IMAGE_NAME=xxx

- export TASK_VERSION=$(xxx

# Set ECS service to desired count 0
- aws ecs update-service --cluster xxx --service xxx --desired-count 0

# Set ECS service to desired count 1 and assign the new task-definition ## testing
- aws ecs update-service --cluster xxx --service wxxx --task-definition xxx:$TASK_VERSION --desired-count 1


The Dockerfile ia almost a default nodejs Dockerfile


# base image
FROM node:9.7.1

# install chrome for protractor tests
RUN wget -q -O - | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -yq google-chrome-stable

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /usr/src/app/package.json

RUN npm install
RUN npm install -g @angular/cli@6.2.2

# add app
COPY . /usr/src/app

# start app
CMD ng serve --port xxx --host xxx

 It takes around 9min for the pipelines start to finish. This way of doing it seems wrong?

and the docker cache seems to not work as well. 

Can´t I do it another way? I have the "same" (very similar) setup for .net core app as well

2 answers

Is there someway to run all Dockerfile steps directly in the pipeline and still push the Dockerfile the AWS microservice cluster? I feel the pipeline could complete in 1min instead of 9min

Or let´s say I use microsoft/dotnet:2.1-sdk in the pipeline and then the same image in the Dockerfile. It pulls the image again. Which doesn´t make sense to me

Suggest an answer

Log in or Sign up to answer
Community showcase

All you wanted to know about customer support KPIs

When working in customer support, it’s crucial to calculate, analyze and monitor specific numbers, called KPIs (Key Performance Indicators). They go hand-in-hand with customer satisfaction, problem d...

46 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you