From 043f36b3a62b0eeaa1c0fc2abe83d936613216e7 Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Sat, 6 Apr 2024 00:37:23 +0200 Subject: [PATCH] Add compose.sh to handle linux/osx/windows differences with podman. can hopefully be removed once /~https://github.com/containers/podman/issues/19852 better handled. --- README.md | 16 ++++++++++++---- compose.sh | 3 +++ docker-compose.yml | 4 +++- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100755 compose.sh diff --git a/README.md b/README.md index 49eb717f71a..ce4be12cffd 100755 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ These instructions will get you a copy of the Quarkus.io website up and running ### Installation -#### Using Docker +#### Using Docker or Podman -1. Install [Docker Desktop](https://docs.docker.com/install/). +1. Install [Docker Desktop](https://docs.docker.com/install/) or [Podman Desktop](https://podman-desktop.io/downloads/). 2. Fork the [project repository](/~https://github.com/quarkusio/quarkusio.github.io), then clone your fork. git clone git@github.com:YOUR_USER_NAME/quarkusio.github.io.git @@ -16,11 +16,19 @@ These instructions will get you a copy of the Quarkus.io website up and running 3. Change into the project directory: cd quarkusio.github.io -4. Run Docker Composer - docker-compose up +4. Run Docker Compose using `compose.sh` + + compose.sh + +5. *OR* run docker compose manually setting _SELINUX_ to "Z:" or "" dependent on OS: + + _SELINUX_=Z: docker compose up # Linux + + _SELINUX_= docker compose up # Mac or Windows 5. Now browse to http://localhost:4000 + #### Using a local Ruby environment [Jekyll static site generator docs](https://jekyllrb.com/docs/). diff --git a/compose.sh b/compose.sh new file mode 100755 index 00000000000..a1be48687ca --- /dev/null +++ b/compose.sh @@ -0,0 +1,3 @@ +export _SELINUX_=$(if [[ "$(uname)" == "Linux" ]]; then echo ":Z"; else echo ""; fi) +echo '$_SELINUX_' +docker-compose up $* diff --git a/docker-compose.yml b/docker-compose.yml index bcea4fc306e..8f7402741ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: # Also, enable dev config command: [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000", "--incremental", "--config", "_config.yml,_config_dev.yml" ] volumes: - - .:/site:Z + ## this Z handling needed to make things + ## work on podman (see /~https://github.com/containers/podman/issues/19852) + - .:/site #${_SELINUX_?_SELINUX_ variable is required and must be set to ':Z' if SELinux context is needed for volumes or run compose.sh to do it for you.} ports: - '4000:4000'