Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pip, black, setuptools, twine, wheel, and aws-sam-cli incorrectly installed in superchain #4201

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions superchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ ENV LANG="C.UTF-8"
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install --no-install-recommends \
acl \
apt-transport-https \
build-essential \
ca-certificates \
Expand All @@ -133,15 +134,24 @@ RUN apt-get update
git \
gnupg \
gzip \
libbz2-dev \
libffi-dev \
libicu-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxmlsec1-dev \
openssl \
rsync \
sudo \
tk-dev \
unzip \
xz-utils \
zip \
acl \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

# Install mono
Expand All @@ -164,10 +174,12 @@ RUN set -eo pipefail
ENV PATH=$PATH:${CARGO_HOME}/bin

# Install Python 3
RUN apt-get update \
&& apt-get -y install python3 python3-dev python3-pip python3-venv \
&& python3 -m venv .venv \
&& source .venv/bin/activate \
ENV PYENV_ROOT="/opt/pyenv"
RUN curl -fSsL "https://pyenv.run" | bash \
&& command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" \
&& eval "$(pyenv init -)" \
&& PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' pyenv install 3.8 \
&& pyenv global 3.8 \
&& python3 -m pip install --no-input --upgrade pip \
&& python3 -m pip install --no-input --upgrade black setuptools twine wheel aws-sam-cli \
&& rm -rf $(pip cache dir) \
Expand Down Expand Up @@ -397,8 +409,10 @@ ENV LANG="C.UTF-8"
\
GOROOT="/opt/golang/go" \
RUSTUP_HOME="/usr/local/rustup" \
CARGO_HOME="/usr/local/cargo"
ENV PATH="${PATH}:${CARGO_HOME}/bin:${GOROOT}/bin:${M2}"
CARGO_HOME="/usr/local/cargo" \
\
PYENV_ROOT="/opt/pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PATH}:${CARGO_HOME}/bin:${GOROOT}/bin:${M2}:${PYENV_ROOT}/bin"

COPY --from=staging / /
VOLUME /var/lib/docker
Expand Down
11 changes: 10 additions & 1 deletion superchain/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ if [[ "${PLATFORM}" == "x86_64" ]]; then
PLATFORM="amd64"
fi

if command -v docker >/dev/null; then
DOCKER=docker
elif command -v finch >/dev/null; then
DOCKER=finch
else
echo "Could not find 'docker' or 'finch' in PATH, aborting..."
exit 1
fi

# Now on to building the image
${DOCKER:-docker} build \
${DOCKER} build \
--target superchain \
--build-arg BUILDPLATFORM=linux/${PLATFORM} \
--build-arg TARGETPLATFORM=linux/${PLATFORM} \
Expand Down
Loading