Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom image not working as expected?

Jimmy Adaro May 13, 2019

Hi there. I'm using a custom Docker image stored in the Docker Hub ("jimmyadaro/gitlab-ci-cd"), it's a simple Alpine image which updates itself and installs OpenSSH and LFTP. Quite simple, right? It works for me in GitLab CI/CD (I even made a simple tutorial like a year ago).

Now, I'm trying to use bash or OpenSSH and I get a pipeline fatal error. These are the commands inside my bitbucket-pipelines.yml file and the errors shown in the Bitbucket's "Pipelines" UI. What could be wrong?

Screen Shot 2019-05-13 at 16.24.35.pngScreen Shot 2019-05-13 at 16.25.16.pngScreen Shot 2019-05-13 at 16.25.43.pngScreen Shot 2019-05-13 at 16.25.58.png

2 answers

0 votes
tk998 September 28, 2019

I have the same problem. Here is my pipeline sript. It will not download the image and use the image as the based.

 

image:
  name: XXXX.dkr.ecr.us-west-2.amazonaws.com/YYY/ZZZ:latest
    aws:
      access-key: $AWS_ACCESS_KEY_ID
      secret-key: $AWS_SECRET_ACCESS_KEY

pipelines:
  default:
    - step:
        name: testing

        deployment: testing
        script:

          # call the build command within my docker container
          - ./build.sh

 

Any idea?

Taylor McLean April 15, 2021

+1 I'm having the same issue. Did you manage to find a solution?

0 votes
xepozz June 13, 2019

Do you found solution?

Jimmy Adaro June 13, 2019

My final solution was to use `bitbucket-pipelines.yml` file to call a new one `bitbucket-pipelines.sh` where I did the whole deployment process instead of using commands/scripts in the "deployment" step, like so:

 

# ...

pipelines:
branches:
# Deploy to UAT / Test based on commit push to "develop" branch
develop:
- step:
name: Build (npm)
# Use a light Node image
image: node:10.15.3
# Cache Node
caches:
- node
# Execute npm ci and build/bundle scripts
script:
# Use npm ci instead of npm install
- npm ci
# Build my thing
- npm run-script build
- step:
# "$ pwd" for this step: "/opt/atlassian/pipelines/agent/build/", inside has all the repo files
name: Deploy to UAT
deployment: uat
# In case you want to trigger this by using Bitbucket's UI, uncomment the next line
#trigger: manual
script:
# Make the deploy file executable and run it
- chmod +x bitbucket-pipelines-uat.sh
- ./bitbucket-pipelines-uat.sh
after-script:
# Remove SSH key (even if this container should be self-destroyed)
- rm -f ~/.ssh/id_rsa

# ...

 

Hope it helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events