Skip to content

Commit

Permalink
add a extra stage to build package inside docker/dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jiang1997 committed Mar 20, 2023
1 parent e62e608 commit 36c5c45
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ on:
- master

env:
HUB: ghcr.io/apache/skywalking-python
HUB: ghcr.io/jiang1997/skywalking-python
PROJECT: skywalking-python

jobs:
build-docker:
if: github.repository == 'apache/skywalking-python'
if: github.repository == 'jiang1997/skywalking-python'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 30
env:
tag: ${{ github.sha }}
VERSION: 1.0.0
steps:
- uses: actions/checkout@v2
Expand All @@ -48,6 +49,4 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
run: |
make env
make package
make push-image
13 changes: 10 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@

ARG BASE_PYTHON_IMAGE

FROM ${BASE_PYTHON_IMAGE}
FROM ${BASE_PYTHON_IMAGE} as base

FROM base as builder

ARG SW_PYTHON_AGENT_PROTOCOL
ARG SW_PYTHON_AGENT_VERSION

COPY dist/apache_skywalking*.whl /tmp/
RUN pip install poetry
COPY ./ /tmp/
RUN make -C /tmp/ package

FROM base as final

RUN pip install --no-cache-dir /tmp/apache_skywalking*.whl
COPY --from=builder /tmp/dist/apache_skywalking*.whl /tmp/
RUN pip install /tmp/apache_skywalking*.whl

# So that the agent can be auto-started when container is started
ENTRYPOINT ["sw-python"]

0 comments on commit 36c5c45

Please sign in to comment.