#Docker Compose installed dependencies not found

1 messages · Page 1 of 1 (latest)

lost berry
#

Hello community!

This is a simple code that seems to install the dependencies properly, but when i try to use them, there is an error with "dependency not found in PATH", in this case curl:
docker_cli = (
dag.container()
.from_("docker/compose:latest")
.with_exec(["apk", "update", "&&", "apk", "add", "bash", "node", "curl", "&&","export", "PATH=$PATH:/usr/bin"])
.with_unix_socket("/var/run/docker.sock", docker)
.with_mounted_directory("/src", orch_dir)
.with_workdir("/src")
.with_exec(["curl", "--version"])
)

Thanks in advance for the help!

#

Docker Compose installed dependencies not found

visual mesa
#

do you mean nodejs instead of node?

#
$ docker run --entrypoint=sh -it docker/compose
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
v3.11.13-12-g2cfa91a2b4 [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.11-124-gf2729ece5a [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
OK: 11284 distinct packages available
/ # apk add bash node curl
ERROR: unsatisfiable constraints:
  node (missing):
    required by: world[node]
/ # apk add bash nodejs curl
(1/12) Installing ncurses-terminfo-base (6.1_p20200118-r4)
(2/12) Installing ncurses-libs (6.1_p20200118-r4)
(3/12) Installing readline (8.0.1-r0)
(4/12) Installing bash (5.0.11-r1)
#

fyi, anything exported also isn't carried over to the next execution

#

if you want to set an env var, you need to use WithEnvVariable

lost berry
#

yep, nodejs, will try... good to know the "WithEnvVariable"... im gonna test with that, but, should i export the PATH? i mean... apk add should install things in a dir in "PATH"

visual mesa
#

oh! also, there's another issue.
with_exec executes all the items in the array as a command.
so it's going to run one command apk, and pass all the rest of it as args to that

lost berry
#

good catch

visual mesa
#

if you want to use a shell, you need to use sh, -c, "all your commands go here"

visual mesa
#

you shouldn't need to override those

lost berry
#

yep, i think you nailed the thing... lemme test 🙂

#

yep, works smoothly 🙂 thanks a lot justin!! Have a good one!