docker compose installation in AWS CodeBuild not working
Description
I'm currently trying to use docker compose from within AWS CodeBuild. I've seen a lot of the other issues that say "just follow the manual install" I'm about to display below, but I am having zero success.
Steps to reproduce the issue:
- Follow instructions from https://docs.docker.com/compose/cli-command/#install-on-linux
# excerpt from my buildspec.yml
# i've tried to install this to /usr/local/lib/docker/cli-plugins with the same results
mkdir -p $HOME/.docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64 -o $HOME/.docker/cli-plugins/docker-compose
chmod +x $HOME/.docker/cli-plugins/docker-compose
- try to use
docker composeafter step 1 in the buildspec.yml and get:
docker: 'compose' is not a docker command.
Describe the results you received: Here's the output from the AWS CodeBuild:
[Container] 2021/11/18 16:29:53 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
18 | [Container] 2021/11/18 16:29:53 Phase context status code: Message:
19 | [Container] 2021/11/18 16:29:53 Entering phase INSTALL
20 | [Container] 2021/11/18 16:29:53 Running command mkdir -p $HOME/.docker/cli-plugins
21 |
22 | [Container] 2021/11/18 16:29:53 Running command curl -SL https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64 -o $HOME/.docker/cli-plugins/docker-compose
23 | % Total % Received % Xferd Average Speed Time Time Time Current
24 | Dload Upload Total Spent Left Speed
25 |
26 | 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
27 | 100 664 100 664 0 0 3569 0 --:--:-- --:--:-- --:--:-- 3569
28 |
29 | 100 23.4M 100 23.4M 0 0 30.4M 0 --:--:-- --:--:-- --:--:-- 30.4M
30 |
31 | [Container] 2021/11/18 16:29:54 Running command chmod +x $HOME/.docker/cli-plugins/docker-compose
32 |
33 | [Container] 2021/11/18 16:29:54 Phase complete: INSTALL State: SUCCEEDED
34 | [Container] 2021/11/18 16:29:54 Phase context status code: Message:
35 | [Container] 2021/11/18 16:29:54 Entering phase PRE_BUILD
36 | [Container] 2021/11/18 16:29:54 Running command docker compose version
37 | docker: 'compose' is not a docker command.
38 | See 'docker --help'
39
Describe the results you expected: I expected docker compose to work as advertised
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker-compose --version:
docker-compose version 1.24.0, build 0aa59064
Output of docker version:
Client: Docker Engine - Community
--
25 | Version: 18.09.6
26 | API version: 1.39
27 | Go version: go1.10.8
28 | Git commit: 481bc77
29 | Built: Sat May 4 02:33:34 2019
30 | OS/Arch: linux/amd64
31 | Experimental: false
Server: Docker Engine - Community
--
34 | Engine:
35 | Version: 18.09.6
36 | API version: 1.39 (minimum version 1.12)
37 | Go version: go1.10.8
38 | Git commit: 481bc77
39 | Built: Sat May 4 02:41:08 2019
40 | OS/Arch: linux/amd64
41 | Experimental: false
Output of docker context show:
You can also run docker context inspect context-name to give us more details but don't forget to remove sensitive content.
docker: 'context' is not a docker command.
Output of docker info:
(paste your output here)
Additional environment details (AWS ECS, Azure ACI, local, etc.): AWS CodeBuild -- attempting to deploy to AWS ECS
@mylons I'm facing the same problem. Did you find any solution?
@mylons
I am also facing the same problem. Some information on the net did not help. Did you manage to solve it?
The current install instructions for the standalone binary distribution worked for me on AWS CodeBuild with the aws/codebuild/amazonlinux2-x86_64-standard:3.0 environment image:
curl -L --no-progress-meter --output /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64
sudo chmod +x /usr/local/bin/docker-compose
Note both docker and docker-compose existed in the environment image prior to installation, but docker-compose was a really old version. I'm also using docker-compose [COMMAND] rather than docker compose [COMMAND].
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.