From 3d7903c68e1e679c4fdcfc2d80220317d86d6540 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Fri, 28 May 2021 13:44:19 -0400 Subject: [PATCH 1/3] Fix permission denied when starting docker with uid 1000 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 53a2c8f54dc76..6ca89e889fd7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,8 +84,8 @@ ENV LANG=C.UTF-8 \ SUPERSET_HOME="/app/superset_home" \ SUPERSET_PORT=8088 -RUN useradd --user-group -d ${SUPERSET_HOME} --no-log-init --shell /bin/bash superset \ - && mkdir -p ${PYTHONPATH} \ +RUN mkdir -p ${PYTHONPATH} \ + && useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \ && apt-get update -y \ && apt-get install -y --no-install-recommends \ build-essential \ From 4ab08b228adade78ee044fee0664b3560e4d6f73 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Fri, 28 May 2021 15:33:48 -0400 Subject: [PATCH 2/3] Test container image for PR build --- .github/workflows/docker.yml | 6 ++++++ docker/container_image_test.yaml | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 docker/container_image_test.yaml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cbbb9a8379877..6bd6e68f809b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,6 +34,12 @@ jobs: docker build --target ci -t ${{ github.sha }} -t "pr-${{ github.event.pull_request.number }}" . docker save ${{ github.sha }} | gzip > ./build/${{ github.sha }}.tar.gz + - name: Test built image + uses: brpaz/structure-tests-action@v1.1.2 + with: + image: "pr-${{ github.event.pull_request.number }}" + configFile: docker/container_image_test.yml + - name: Upload build artifacts if: github.event_name == 'pull_request' uses: actions/upload-artifact@v2 diff --git a/docker/container_image_test.yaml b/docker/container_image_test.yaml new file mode 100644 index 0000000000000..5e61f2cd9b81f --- /dev/null +++ b/docker/container_image_test.yaml @@ -0,0 +1,11 @@ +schemaVersion: "2.0.0" +fileExistenceTests: +- name: superset_home + path: /app/superset_home + uid: 1000 + gid: 1000 +metadataTest: + env: + - key: SUPERSET_HOME + value: /app/superset_home + exposedPorts: ["8088"] From 24966ae14337a468a76cc9234ff4562fd2887312 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Fri, 28 May 2021 15:48:30 -0400 Subject: [PATCH 3/3] Add required license header to fix build --- docker/container_image_test.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docker/container_image_test.yaml b/docker/container_image_test.yaml index 5e61f2cd9b81f..4c824c75e731b 100644 --- a/docker/container_image_test.yaml +++ b/docker/container_image_test.yaml @@ -1,3 +1,19 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# schemaVersion: "2.0.0" fileExistenceTests: - name: superset_home