Closed oh-tarnished closed 8 months ago
@oh-tarnished as the error states, none of the common anchors have a run
or build
configuration for the plugin. Based on the step's configuraton, I assume that you are trying to run the command specified in the container, so you would need to add a run
element to the plugin's configuration with the name of the service you want to run the script on.
How can I set the workdir for the Docker Compose plugin while keeping the common attribute functional? since i need to change the directory to run the commands.
That depends on how or why the workdir
would need to change. If it is depending on the architecture, you could have different workdir configurations for each common element. If not, let us know exactly your scenario and we can further troubleshoot.
Hey @toote, Thank you for the docker-compose
command issue (fixed it). So our CI is with @bazelbuild, and there are multiple workspaces where the CI needs to run on hence the workdir
needs to be changed else bazel
throws an error. The commands needs to be executed in the dir
of the project. and we have multiple of them.
@oh-tarnished interesting usecase. I am not too familiar with Bazel builds but you could always change the directory in your script being run instead of relying on the pipeline to specify the folder correctly. If your script does not have enough information for that, you could use an environment variable set at the pipeline, step or plugin level to pass through to the script instead. Alternatively, you can always remove the workdir
option from the plugin to have the command be run in the container's default directory (assuming that it is set correctly in the corresponding Dockerfile when the image is built).
What do you think?
@toote Well yeah that works, thank you. It was my bad i was trying to do it wrong. fixed it.
Right now i'm facing another issue with docker-compose
using cached images.
Following up on the previously reported issue, we are still experiencing problems with Docker image tagging and pushing in our Buildkite pipeline. The error persists when trying to tag and push images to Docker Hub, particularly with our multi-architecture setup (x86 and arm64).
[2023-12-21T06:46:07Z] $ docker tag buildkite018c8b1e0f8c4010810dd67ea35fab8d_tryoutlab_workspace tryoutlab_workspace:dockerhub/tryoutlab:tryoutlab-workspace-latest
[2023-12-21T06:46:07Z] Error response from daemon: No such image: buildkite018c8b1e0f8c4010810dd67ea35fab8d_tryoutlab_workspace:latest
[2023-12-21T06:46:07Z] 🚨 Error: The command exited with status 1
pipeline.yaml
# Buildkite Pipeline Configuration for tryoutlab
env:
PROJECT_ENVIRONMENT: buildkite
DRY_RUN: false
common:
- docker_workspace: &run_docker_workspace
docker-compose#v4.16.0:
run: tryoutlab_workspace
config: .buildkite/docker-compose.yaml
workdir: /workspace
image-name: tryoutlab-build-${BUILDKITE_BRANCH}
image-repository: dockerhub/tryoutlab
cache-from:
- tryoutlab_workspace:dockerhub/tryoutlab:tryoutlab-workspace-latest
- tryoutlab_workspace:dockerhub/tryoutlab:tryoutlab-workspace-${BUILDKITE_BRANCH}
steps:
- label: ":sweating: Random Check ✨"
command: .buildkite/steps/blah.sh
plugins: *docker_workspace
- label: ":broom: Cleanup: Push :buildkite: Cache Images to :docker: Hub"
plugins:
- docker-compose#v4.16.0:
config: .buildkite/docker-compose.yaml
push:
- tryoutlab_workspace:dockerhub/tryoutlab:tryoutlab-workspace-latest
- tryoutlab_workspace:dockerhub/tryoutlab:tryoutlab-workspace-${BUILDKITE_BRANCH}
:latest
tag Is there a way to ignore the default :latest
tag? According to the documentation, it is set by default.Looking forward to any further advice or solutions to this persisting issue.
Hey @oh-tarnished! can you send that question to Support? as is not an issue related specifically with the plugin. Thanks!
Description
I am encountering an issue with the Docker Compose plugin in Buildkite. Despite setting up a
common
attribute for Docker Compose configuration, the plugin fails with an error indicating that no build or run options are specified.Configuration
common:
env_x86_64: &env_x86_64_var docker-compose#v4.16.0: workdir: /app config:
env_arm64: &env_arm64_var docker-compose#v4.16.0: workdir: /app config:
steps:
workdir
for the Docker Compose plugin while keeping the common attribute functional? since i need to change the directory to run the commands.