Full error log (i uploaded to github to simplify): https://raw.githubusercontent.com/seriseyes/bitbucket-error/main/error
# bitbucket-pipelines.yml
image: node:21.6.0-alpine3.19
pipelines:
custom:
deploy:
- step:
runs-on: office
name: Build and Push Docker Image
size: 2x
script:
- docker info
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin harbor.medsoft.care
- TAG=$(echo $BITBUCKET_COMMIT | head -c 8) # Use the first 8 characters of the commit hash as the tag
- DOCKER_BUILDKIT=1 docker build -t harbor.medsoft.care/medsoft8/ui:$TAG .
- docker push harbor.medsoft.care/medsoft8/ui:$TAG
after-script:
- cat /root/.npm/_logs/*
services:
- docker
#Dockerfile
FROM node:21.6.0-alpine3.19 as builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/dist .
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]
Hi @bayarkhuu and welcome to the community!
The exit code: 137 mentioned in the logs you provided usually indicates a memory issue.
Your step has size: 2x, so 8 GB of memory will be available for this step (if the host machine has that memory available). However, the docker service gets only 1024 MB of that memory. This is the default amount of memory that a service gets unless you specify otherwise in your bitbucket-pipelines.yml file.
For a step with size: 2x, you can configure a service to use up to 7128 MB of memory. You can do that by adding in your bitbucket-pipelines.yml file a definition as follows (you can change the value to anything up to 7128):
definitions:
services:
docker:
memory: 2048
You can check our documentation on services for more details:
Please feel free to let me know how it goes and if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.