accetto / ubuntu-vnc-xfce-g3

Headless Ubuntu/Xfce containers with VNC/noVNC (G3v6).
MIT License
214 stars 62 forks source link

Can't seem to run `builder.sh` script following documentation in README #38

Closed capsulecorplab closed 1 year ago

capsulecorplab commented 1 year ago

Hello, I'm attempting to follow the README under building images for building just the image locally, but I'm encountering the following error,

$ ./builder.sh latest build

==> EXECUTING @2023-03-05_16-42-57: ./builder.sh 

./builder.sh: line 84: ./docker/hooks/build: Permission denied

Steps to reproduce

OS

Linux Mint 21.1

accetto commented 1 year ago

Hello @capsulecorplab,

thank you for your feedback.

Please check the permissions of the files in the folder /docker/hooks and also of the *.sh files in the project root folder. You are not allowed to execute them or they are not marked as executable.

You can fix it by executing the following commands (from the project's root directory):

find . -type f -name "*.sh" -exec chmod +x '{}' \;
chmod +x docker/hooks/*

It'll make all the *.sh files in the project and all the files in the docker/hooks folder executable.

I should probably mention it in the documentation.

Regards, accetto

capsulecorplab commented 1 year ago

Thanks @accetto, I ran the aforementioned commands to make all the *.sh files and files in docker/hooks executable and reran the builder script, but encountered the following,

$ ./builder.sh latest build

==> EXECUTING @2023-03-05_18-12-24: ./builder.sh 

==> EXECUTING @2023-03-05_18-12-24: ./docker/hooks/build dev latest

./docker/hooks/env.rc: line 31: REPO_OWNER_NAME: Need repo owner name
accetto commented 1 year ago

This message says, that the mandatory environment variable REPO_OWNER_NAME is not set. You can check the line 31 in the file env.rc and see that it's required. This variable defines the image/repository owner name. In my case it's accetto. You can use your own name, e.g. my, example or anything else.

Have you edited and sourced the file defining the required environment variables?

You can follow the procedure described in the preparation part of the readme file.

accetto commented 1 year ago

FYI: Thanks to your feedback I could improve the documentation. You can check the updated local-building-example or also the image readme files on Git Hub or Docker Hub.

BTW, I didn't have any time yet to test your scenario with building my images using docker compose. Could you please send me an example yaml file you use? It would be the best to open a new issue for it.

Thanks.

capsulecorplab commented 1 year ago

@accetto thanks for the updates to the readme, I tried checking out the latest v23.03 release, then copying and sourcing the secrets.rc file, but I'm still getting the same repo name error as before when attempting to run the build - same issue if I copy the secrets.rc file to docker/hooks/

$ ./builder.sh latest build

==> EXECUTING @2023-03-08_17-20-10: ./builder.sh 

==> EXECUTING @2023-03-08_17-20-10: ./docker/hooks/build dev latest

./docker/hooks/env.rc: line 31: REPO_OWNER_NAME: Need repo owner name
accetto commented 1 year ago

Hello @capsulecorplab ,

I'm trying to realise in what unexpected case this could happen, but no success yet. :)

Are you absolutely sure that you have the following line in yout secrets.rc file?

export REPO_OWNER_NAME="accetto"

You can also try to change the line 31 in the file env.rc like this:

declare _owner="${REPO_OWNER_NAME:-accetto}"

You can use your own name if you wish.

Please be also sure that you execute the builder.sh script from the project's root directory.

It simply must work. If you still will have issues, then I would need more information about your environment, to try to reproduce it.

Btw, there is one more line of this kind in the files secrets.rc and env.rc (the line 48).

### in file 'secrets.rc'
export BUILDER_REPO="headless-ubuntu-g3"

### in file 'env.rc'
DOCKER_REPO="${_owner}/${BUILDER_REPO:?Need builder repo name}"
### you can modify it like this
DOCKER_REPO="${_owner}/${BUILDER_REPO:-headless-ubuntu-g3}"

Again, you can use your own name if you wish.

Regards, accetto

capsulecorplab commented 1 year ago

Ah~ Setting export REPO_OWNER_NAME="accetto" and export BUILDER_REPO="headless-ubuntu-g3" did the trick; it's building now!

capsulecorplab commented 1 year ago

Looks like it's working! Screenshot from 2023-03-08 12-10-28

I was able to start the session by running docker-compose up with the following docker-compose.yml file

---
version: "3.7"
services:
  ubuntu-vnc-xfce-g3:
    build: .
    image: accetto/ubuntu-vnc-xfce-g3:latest
    ports:
      - "5901:5901"
    user: "0"
    environment:
      VNC_PW: password
    shm_size: '512m'
    stdin_open: true # docker run -i
    tty: true        # docker run -t
    volumes:
      - type: bind
        source: ./shared
        target: /home/headless/shared
    security_opt:
      - seccomp=unconfined
...
capsulecorplab commented 1 year ago

Also opened a discussion thread for using docker-compose https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions/39

accetto commented 1 year ago

I'm really glad that you've got it working. :)

Thank you for opening the issue #40. Also the discussion topic #39 is a really good idea and I appreciate it.

I'll come to it a little bit later because now I'm working on an update of the sibling project accetto/headless-drawing-g3. The next version images will be based on Ubuntu 22.04 LTS and they will contain newer versions of the applications from the Ubuntu distribution.