Sign inSign up

jericop/conda-env-update

By jericop

•Updated about 4 years ago

Cloud Native Buildpack for conda-env-update with support for all stacks

Image
0

343

jericop/conda-env-update repository overview

⁠jericop/conda-env-update

This is a clone of the paketo-buildpacks/conda-env-update buildpack with support for all stacks. The buildpack.toml file is modified as shown below, but no other changes were made.

Repo url: https://github.com/paketo-buildpacks/conda-env-update⁠

⁠What is a buildpack?

See: https://buildpacks.io⁠

⁠How to use this buildpack

⁠Clone the paketo samples repo

This contains sample applications for different languages that can be used to build app containers.

git clone https://github.com/paketo-buildpacks/samples.git

We will be using the example app located here: samples/python/conda

⁠Build a container using this buildpack on a custom amazonlinux stack

The amazonlinux builder does not include any buildpacks, so we need to specify all buildpacks.

pack build amazonlinux-conda-sample --path samples/python/conda \
  --builder jericop/amazonlinux-builder:base \
  --buildpack jericop/miniconda:latest \
  --buildpack jericop/conda-env-update:latest \
  --buildpack paketo-buildpacks/python-start \
  --buildpack paketo-buildpacks/procfile

⁠Show the buildpacks used to build the container

pack inspect amazonlinux-conda-sample

⁠Verify the app container works

The sample app is a flask web app.

See samples/python/conda/README.md for instructions on running the container.

⁠Verify the container has the required modules installed

docker run --rm -it --entrypoint launcher amazonlinux-conda-sample python -m pip list

⁠How this was built

# Clone the paketo-buildpacks/conda-env-update repo and build binaries (assumes go is installed)
git clone [email protected]:paketo-buildpacks/conda-env-update.git
cd conda-env-update
./scripts/build.sh

mkdir to-be-packaged

# Move the buildpack binaries to the to-be-packaged directory
mv bin to-be-packaged/

# Create a package.toml file that points to the current directory
cat <<EOF > to-be-packaged/package.toml
[buildpack]
uri = "file://./"
EOF

# Add version and update all stacks lists to use "*"
cat buildpack.toml | yj -tj | jq '.buildpack += {version: "9.9.9"} | . + {stacks: [{id: "*"}]}' | yj -jt > to-be-packaged/buildpack.toml

cd to-be-packaged

# Create a buildpack image and publish it to docker hub
pack buildpack package jericop/conda-env-update:latest --config package.toml --publish

# Clean up so there are no changes in the repo
cd .. && rm -r to-be-packaged

Tag summary

Content type

Image

Digest

sha256:0bb5c8cf2…

Size

9.3 MB

Last updated

about 4 years ago

docker pull jericop/conda-env-update