sobojack
I have a Phoenix app that I am deploy to Kuberenetes. My deploy script was working fine then all of a sudden it started erroring out asking for python. I tried adding adp add python but that did not help. I am using bitwalker/alpine-elixir:latest and bitwalker/alpine-erlang-base:latest. My error is $ apk add --update make ca-certificates openssl python fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz ERROR: unsatisfiable constraints: python (missing): required by: world[python] ERROR: Job failed: exit code 1
My gitlab-ci.yaml file looks like this
stages:
- assets
- build
- deploy
assets:
image: node:11
stage: assets
script:
- cd assets
- npm install
- npm run elm-package-install
- npm run deploy
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- assets/node_modules/
- assets/elm-stuff/
artifacts:
paths:
- priv/static/
# Build the app
build:
image: bitwalker/alpine-elixir:latest
stage: build
script:
# Add required build dependencies
- apk update
- apk upgrade
- apk add build-base
# First thing, let's check code formatting
- mix format --check-formatted
# Install Dependencies
- mix deps.get
# Run tests
# - mix test
# Build Assets
- MIX_ENV=prod mix compile
- MIX_ENV=prod mix phx.digest
# Build release
- MIX_ENV=prod mix distillery.release --env=prod
# Store Release
- export RELEASE_DIR=`ls -d _build/prod/rel/order_management_portal/releases/*/`
- mv $RELEASE_DIR/order_management_portal.tar.gz order_management_portal.tar.gz
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- deps
- _build/test
- _build/prod
artifacts:
paths:
- order_management_portal.tar.gz
# DEPLOY THE APP WITH DOCKER
deploy:
stage: deploy
only:
- dev
- stage
- master
dependencies:
- build
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
IMAGE_NAME: order-management
GCP_PROJECT_ID: beswick-engineering
services:
- docker:dind
script:
# Create our image.
# Unzip application tarball
- mkdir export
- tar -xf "order_management_portal.tar.gz" -C export
# Build docker image
- docker build -t $IMAGE_NAME:$CI_COMMIT_REF_SLUG .
# Install CA certs, openssl to https downloads, python for gcloud sdk
- apk add --update make ca-certificates openssl python
- update-ca-certificates
# Write our GCP service account private key into a file
- echo $GCLOUD_SERVICE_KEY | base64 -d > ${HOME}/gcloud-service-key.json
# Download and install Google Cloud SDK
- wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
- tar zxf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true
- google-cloud-sdk/bin/gcloud --quiet components update
- google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
# Push to registry
# Tag our image for container registry
- docker tag $IMAGE_NAME:$CI_COMMIT_REF_SLUG gcr.io/$GCP_PROJECT_ID/$IMAGE_NAME:$CI_COMMIT_REF_SLUG
# Push to repository
- google-cloud-sdk/bin/gcloud docker -- push gcr.io/$GCP_PROJECT_ID/$IMAGE_NAME:$CI_COMMIT_REF_SLUG
# Deploy only for master branch
- |
if [ "$CI_COMMIT_REF_SLUG" = "dev" ]; then
# Configure Kube control
google-cloud-sdk/bin/gcloud components install kubectl
google-cloud-sdk/bin/gcloud container clusters get-credentials beswick --zone us-central1-a --project $GCP_PROJECT_ID
google-cloud-sdk/bin/kubectl patch deployment order-manager-dev -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
else if [ "$CI_COMMIT_REF_SLUG" = "master" ]; then
# Configure Kube control
google-cloud-sdk/bin/gcloud components install kubectl
google-cloud-sdk/bin/gcloud container clusters get-credentials beswick --zone us-central1-a --project $GCP_PROJECT_ID
google-cloud-sdk/bin/kubectl patch deployment order-manager-prod -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
fi
fi
and my dockerfile looks like this
#================
#Deployment Stage
#================
FROM bitwalker/alpine-erlang-base:latest
# RUN add erlang-cryto
#Set environment variables and expose port
EXPOSE 4000
ENV REPLACE_OS_VARS=true
ENV PORT=4000
COPY export/ .
CMD ["/opt/app/bin/order_management_portal", "foreground"]
Any help would be greatly appreciated!
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











Marked As Solved
sobojack
changing this
- apk add --update make ca-certificates openssl pythonto this
- apk add --update make ca-certificates openssl python2was the fix