Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: trunk: not found - docker timescaledb alpine #682

Open
agustinvinao opened this issue Apr 3, 2024 · 1 comment
Open

sh: trunk: not found - docker timescaledb alpine #682

agustinvinao opened this issue Apr 3, 2024 · 1 comment

Comments

@agustinvinao
Copy link

Im trying to run pg-trunk in a timescaledb docker image with the following dockerfile:

FROM timescale/timescaledb:latest-pg16

RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/testing \
    python3 \
    postgresql-plpython3 \
    curl \
    build-base \
    openssl \
    openssl-dev \
    musl-dev cmake make gcc g++ curl strace

RUN curl https://sh.rustup.rs -sSf | \
    sh -s -- --default-toolchain stable -y
ENV PATH=/root/.cargo/bin:$PATH
ENV OPENSSL_DIR=/usr 

RUN cargo install pg-trunk

After building the image and inside the container, when I run trunk I see the error sh: trunk: not found

/ # ls -la /root/.cargo/bin/
total 221160
drwxr-xr-x    1 root     root          4096 Apr  2 23:40 .
drwxr-xr-x    1 root     root          4096 Apr  2 23:37 ..
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 cargo
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 cargo-clippy
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 cargo-fmt
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 cargo-miri
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 clippy-driver
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rls
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rust-analyzer
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rust-gdb
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rust-gdbgui
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rust-lldb
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rustc
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rustdoc
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rustfmt
-rwxr-xr-x   14 root     root      15448048 Apr  2 23:36 rustup
-rwxr-xr-x    1 root     root      10168576 Apr  2 23:40 trunk

/ # rustup --version
rustup 1.27.0 (bbb9276d2 2024-03-08)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.77.1 (7cf61ebde 2024-03-27)`

/ # cargo 1.77.1 (e52e36006 2024-03-26)
/ # ls -la /root/.cargo/bin/

/ # echo $PATH
/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

/ # which trunk
/root/.cargo/bin/trunk

Im guessing it could be some issue with a dependency but I dont have any info to debug.

/ # trunk
sh: trunk: not found

thanks for your help.

I don't understand why Im getting this error

@brianpursley
Copy link
Contributor

@agustinvinao, I was curious, so I tried it, using the Dockerfile you posted, but I don't get the error. Am I doing something different?

~/projects/test-trunk-682 $ docker build -t trunk-682 .
[+] Building 370.8s (9/9) FINISHED                                                                       docker:default
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 473B                                                                               0.0s
 => [internal] load metadata for docker.io/timescale/timescaledb:latest-pg16                                       0.8s
 => [auth] timescale/timescaledb:pull token for registry-1.docker.io                                               0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [1/4] FROM docker.io/timescale/timescaledb:latest-pg16@sha256:bb6341adc845dff2da0d1facdd5e9e23a8ee8c0cf6e737  21.2s
 => => resolve docker.io/timescale/timescaledb:latest-pg16@sha256:bb6341adc845dff2da0d1facdd5e9e23a8ee8c0cf6e737a  0.0s
 => => sha256:bb6341adc845dff2da0d1facdd5e9e23a8ee8c0cf6e737af0a3479d26af4026b 3.91kB / 3.91kB                     0.0s
 => => sha256:09f6a74f70f1a799f4d6af5423cf513af8357deb3fd0c7cb4743ad94c7b344f5 3.91kB / 3.91kB                     0.0s
 => => sha256:a05badc7ec0afebcb2bed81da6c4a55ba9dce078b78f9e269bdaf4b04c753818 14.81kB / 14.81kB                   0.0s
 => => sha256:3f16450db19da26466c4148aebc4c0b7ff5cf1150122ca2ab6772b074f427d51 5.13MB / 5.13MB                     1.1s
 => => sha256:8a638e62c2bc5940eaf5fa6bd6dcb4b362517d92a7e0f2c1ff476be6f82386ac 19.41MB / 19.41MB                  17.7s
 => => sha256:286e4d60b090fc40c208f5370e855a1762f0dbc6957b72fd4116e9d839a92529 23.63MB / 23.63MB                  16.6s
 => => sha256:9cf9e9b4b58023854eeedf846d23350306d5c93a56198c12431ad5cfbd45d226 2.12kB / 2.12kB                     1.4s
 => => sha256:0d0d9aa0ec18fcf36f58710325c230fe490c70f6b8409b58fbf2ddca58eda2e0 6.33MB / 6.33MB                     3.7s
 => => sha256:64c81bd9c01ca4eff4e37211d293b7081d1390f7fabad6ff15b014a034e7e082 33.61MB / 33.61MB                  15.9s
 => => sha256:247cfa700895e08739b822c09175029f2e1d35c18ef6eaa47cd3a21f89272828 13.44MB / 13.44MB                  19.6s
 => => extracting sha256:286e4d60b090fc40c208f5370e855a1762f0dbc6957b72fd4116e9d839a92529                          0.7s
 => => sha256:ddafbe3419aa8bc44d9cfac31d3f986bd579abc13b76e6cd360d3c9692567952 6.98MB / 6.98MB                    20.6s
 => => extracting sha256:3f16450db19da26466c4148aebc4c0b7ff5cf1150122ca2ab6772b074f427d51                          0.1s
 => => extracting sha256:8a638e62c2bc5940eaf5fa6bd6dcb4b362517d92a7e0f2c1ff476be6f82386ac                          0.6s
 => => extracting sha256:9cf9e9b4b58023854eeedf846d23350306d5c93a56198c12431ad5cfbd45d226                          0.0s
 => => extracting sha256:0d0d9aa0ec18fcf36f58710325c230fe490c70f6b8409b58fbf2ddca58eda2e0                          0.1s
 => => extracting sha256:64c81bd9c01ca4eff4e37211d293b7081d1390f7fabad6ff15b014a034e7e082                          0.8s
 => => extracting sha256:247cfa700895e08739b822c09175029f2e1d35c18ef6eaa47cd3a21f89272828                          0.5s
 => => extracting sha256:ddafbe3419aa8bc44d9cfac31d3f986bd579abc13b76e6cd360d3c9692567952                          0.2s
 => [2/4] RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/testing     python3     post  20.6s
 => [3/4] RUN curl https://sh.rustup.rs -sSf |     sh -s -- --default-toolchain stable -y                         55.6s 
 => [4/4] RUN cargo install pg-trunk                                                                             267.3s 
 => exporting to image                                                                                             5.2s 
 => => exporting layers                                                                                            5.2s 
 => => writing image sha256:5746160dc8fb496098be5107d3b301c757a09240c2b4388e03c1760d22e7fc04                       0.0s 
 => => naming to docker.io/library/trunk-682                                                                       0.0s 
~/projects/test-trunk-682 $ 
~/projects/test-trunk-682 $ docker run --name trunk-682 -e POSTGRES_PASSWORD=mysecretpassword -d trunk-682
3c371af4679e083167fe58650e5c24f52d5c55f7157de82f511efdb9ba5080a7
~/projects/test-trunk-682 $ docker ps
CONTAINER ID   IMAGE       COMMAND                  CREATED         STATUS        PORTS      NAMES
3c371af4679e   trunk-682   "docker-entrypoint.s…"   2 seconds ago   Up 1 second   5432/tcp   trunk-682
~/projects/test-trunk-682 $ docker exec -it trunk-682 /bin/sh
/ # trunk
A package manager for PostgreSQL extensions

Usage: trunk <COMMAND>

Commands:
  build    Build a PGRX or C based Postgres extension
  publish  Publish a Postgres extension to the Trunk registry
  install  Install a Postgres extension from the Trunk registry
  verify   Verify a local install of a Postgres extension by running its regression tests
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version
/ # 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants