Skip to content

Commit

Permalink
Sre 1014/sloctl docker image (#1)
Browse files Browse the repository at this point in the history
* add dockerfile

* update dockerfile

* update filepath

* copy repo in docker

* remove install line

* update dockerfile copy path

* add platform to dockerfile

* remove platform

* replace scratch with alpine

* refresh dockerfile with alpine image

* add user and mkdir

* try dockerfile without glib dependency lines

* final dockerfile set up with glib

* add mkdir and chown lines to dockerfile

* add codefresh yml

* remove unecessary lines and update version tag
  • Loading branch information
a-hales authored Sep 23, 2022
1 parent 9066b8c commit 8941547
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM --platform=linux/x86_64 alpine:latest
ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc
ENV GLIBC_VERSION=2.30-r0
RUN set -ex && \
apk --update add libstdc++ curl ca-certificates && \
for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \
do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
apk add --allow-untrusted /tmp/*.apk && \
rm -v /tmp/*.apk && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib
COPY ./sloctl /usr/local/bin/sloctl
RUN adduser -D appuser
RUN mkdir -p /home/appuser/.config/nobl9
RUN chown -R appuser:appuser /home/appuser/.config/nobl9
USER appuser
ENTRYPOINT ["sloctl"]
44 changes: 44 additions & 0 deletions codefresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "1.0"

stages:
- "clone"
- "build"

steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "nobl9/sloctl"
# CF_BRANCH value is auto set when pipeline is triggered
# Learn more at codefresh.io/docs/docs/codefresh-yaml/variables/
revision: "${{CF_BRANCH}}"
git: "github"
stage: "clone"

install:
title: "Install sloctl"
type: "freestyle" # Run any command
image: "ubuntu:latest" # The image in which command will be executed
working_directory: "${{clone}}" # Running command where code cloned
commands:
- "apt-get update"
- "apt-get install -y git"
- "apt-get install zip unzip"
- "unzip sloctl-linux-*.zip"
- "rm sloctl-*.zip"
- "cf_export VERSION=$(git describe --tags --abbrev=0)"
stage: "build"

build:
title: "Building docker image"
type: "build"
working_directory: "${{clone}}"
arguments:
image_name: "nobl9/sloctl"
dockerfile: 'Dockerfile'
registry: "nobl9"
tags:
- "latest"
- "v${{VERSION}}"
stage: "build"

0 comments on commit 8941547

Please sign in to comment.