File tree Expand file tree Collapse file tree 7 files changed +34
-14
lines changed Expand file tree Collapse file tree 7 files changed +34
-14
lines changed Original file line number Diff line number Diff line change 1- ARG IMAGE=ghcr.io/newrelic-experimental/pyenv-devcontainer:latest
2-
31# To target other architectures, change the --platform directive in the Dockerfile.
4- FROM --platform=linux/amd64 ${IMAGE}
2+ ARG IMAGE_TAG=latest
3+ FROM ghcr.io/newrelic/newrelic-python-agent-ci:${IMAGE_TAG}
4+
5+ # Setup non-root user
6+ USER root
7+ ARG UID=1000
8+ ARG GID=$UID
9+ ENV HOME /home/vscode
10+ RUN mkdir -p ${HOME} && \
11+ groupadd --gid ${GID} vscode && \
12+ useradd --uid ${UID} --gid ${GID} --home ${HOME} vscode && \
13+ chown -R ${UID}:${GID} /home/vscode
14+ USER ${UID}:${GID}
Original file line number Diff line number Diff line change 55 // To target other architectures, change the --platform directive in the Dockerfile.
66 "dockerfile" : " Dockerfile" ,
77 "args" : {
8- "IMAGE " : " ghcr.io/newrelic-experimental/pyenv-devcontainer: latest"
8+ "IMAGE_TAG " : " latest"
99 }
1010 },
1111 "remoteUser" : " vscode" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
2323 build-essential \
2424 curl \
2525 expat \
26+ fish \
27+ fontconfig \
2628 freetds-common \
2729 freetds-dev \
2830 gcc \
@@ -46,13 +48,16 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4648 python2-dev \
4749 python3-dev \
4850 python3-pip \
51+ sudo \
4952 tzdata \
5053 unixodbc-dev \
5154 unzip \
55+ vim \
5256 wget \
5357 zip \
5458 zlib1g \
55- zlib1g-dev && \
59+ zlib1g-dev \
60+ zsh && \
5661 rm -rf /var/lib/apt/lists/*
5762
5863# Build librdkafka from source
@@ -93,6 +98,10 @@ RUN echo 'eval "$(pyenv init -)"' >>$HOME/.bashrc && \
9398# Install Python
9499ARG PYTHON_VERSIONS="3.10 3.9 3.8 3.7 3.11 2.7 pypy2.7-7.3.12 pypy3.8-7.3.11"
95100COPY --chown=1000:1000 --chmod=+x ./install-python.sh /tmp/install-python.sh
96- COPY ./requirements.txt /requirements.txt
97101RUN /tmp/install-python.sh && \
98102 rm /tmp/install-python.sh
103+
104+ # Install dependencies for main python installation
105+ COPY ./requirements.txt /tmp/requirements.txt
106+ RUN pyenv exec pip install --upgrade -r /tmp/requirements.txt && \
107+ rm /tmp/requirements.txt
Original file line number Diff line number Diff line change @@ -19,16 +19,16 @@ REPO_ROOT:=$(realpath $(MAKEFILE_DIR)../../)
1919.PHONY : default
2020default : test
2121
22+ # Perform a shortened build for testing
2223.PHONY : build
2324build :
24- @# Perform a shortened build for testing
2525 @docker build $(MAKEFILE_DIR ) \
2626 -t ghcr.io/newrelic/newrelic-python-agent-ci:local \
2727 --build-arg=' PYTHON_VERSIONS=3.10 2.7'
2828
29+ # Ensure python versions are usable
2930.PHONY : test
3031test : build
31- @# Ensure python versions are usable
3232 @docker run --rm ghcr.io/newrelic/python-agent-ci:local /bin/bash -c ' \
3333 python3.10 --version && \
3434 python2.7 --version && \
Original file line number Diff line number Diff line change @@ -45,9 +45,6 @@ main() {
4545
4646 # Set all installed versions as globally accessible
4747 pyenv global ${PYENV_VERSIONS[@]}
48-
49- # Install dependencies for main python installation
50- pyenv exec pip install --upgrade -r /requirements.txt
5148}
5249
5350main
Original file line number Diff line number Diff line change 1+ bandit
2+ black
3+ flake8
4+ isort
15pip
26setuptools
3- wheel
7+ tox
48virtualenv < 20.22.0
5- tox
9+ wheel
Original file line number Diff line number Diff line change 6363 with :
6464 push : ${{ github.event_name != 'pull_request' }}
6565 context : .github/containers
66- platforms : linux/amd64
66+ platforms : ${{ (github.ref == 'refs/head/main') && ' linux/amd64,linux/arm64' || 'linux/amd64' }}
6767 tags : ${{ steps.meta.outputs.tags }}
6868 labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments