Skip to content

Commit

Permalink
Add Dockerfile to buld image based on Fedora36 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan authored Aug 30, 2022
1 parent 4adcfc8 commit 660c5b2
Show file tree
Hide file tree
Showing 12 changed files with 533 additions and 9 deletions.
25 changes: 19 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ def main(ctx):
'2.9',
'latest',
'source',
'fedora',
]

arches = [
'amd64',
]

# image's base version
# For example, in latest's Dockerfile;
# FROM ubuntu:22.04
# then,
# 'latest': '22.04'
base_img_tag = {
'latest': ['ubuntu', '22.04'],
'fedora': ['fedora', '36'],
}

config = {
'version': None,
'arch': None,
Expand All @@ -21,7 +32,7 @@ def main(ctx):
for version in versions:
config['version'] = version

if config['version'] in ['latest', 'source']:
if config['version'] in ['latest', 'source', 'fedora']:
config['path'] = config['version']
else:
config['path'] = 'v%s' % config['version']
Expand All @@ -33,9 +44,11 @@ def main(ctx):
config['arch'] = arch

if config['version'] == 'latest':
config['tag'] = arch
config['tags'] = ['%s-%s' % (base_img_tag[config['version']][0], arch)]
else:
config['tag'] = '%s-%s' % (config['version'], arch)
config['tags'] = ['%s-%s' % (config['version'], arch)]
if config['version'] in base_img_tag:
config['tags'].append('%s-%s-%s' % (base_img_tag[config['version']][0], base_img_tag[config['version']][1], arch))

if config['arch'] == 'amd64':
config['platform'] = 'amd64'
Expand All @@ -46,7 +59,7 @@ def main(ctx):
if config['arch'] == 'arm32v7':
config['platform'] = 'arm'

config['internal'] = '%s-%s' % (ctx.build.commit, config['tag'])
config['internal'] = '%s-%s' % (ctx.build.commit, config['tags'])

d = docker(config)
m['depends_on'].append(d['name'])
Expand Down Expand Up @@ -191,7 +204,7 @@ def dryrun(config):
'image': 'plugins/docker',
'settings': {
'dry_run': True,
'tags': config['tag'],
'tags': config['tags'],
'dockerfile': '%s/Dockerfile.%s' % (config['path'], config['arch']),
'repo': 'owncloudci/%s' % config['repo'],
'context': config['path'],
Expand All @@ -214,7 +227,7 @@ def publish(config):
'password': {
'from_secret': 'public_password',
},
'tags': config['tag'],
'tags': config['tags'],
'dockerfile': '%s/Dockerfile.%s' % (config['path'], config['arch']),
'repo': 'owncloudci/%s' % config['repo'],
'context': config['path'],
Expand Down
67 changes: 67 additions & 0 deletions fedora/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM fedora:36

LABEL maintainer="ownCloud DevOps <devops@owncloud.com>" \
org.label-schema.name="ownCloud Client" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"

ENV TERM xterm

ADD https://github.com/owncloud-ci/wait-for/releases/download/v1.0.2/wait-for-linux-amd64 /usr/bin/wait-for

ENV SU_EXEC_CHECKSUM=0f25a21cf64e58078057adc78f38705163c1d564a959ff30a891c31917011a54
ADD https://github.com/tianon/gosu/releases/download/1.12/gosu-amd64 /usr/bin/su-exec

ENV GOMPLATE_CHECKSUM=7dbabe30095f822ec38f5f70711ff121c26e588227da4cc05208417cfaf929cd
ADD https://github.com/hairyhenderson/gomplate/releases/download/v3.9.0/gomplate_linux-amd64 /usr/bin/gomplate

RUN chmod +x /usr/bin/wait-for && \
echo "${SU_EXEC_CHECKSUM} /usr/bin/su-exec" | sha256sum -c - && \
chmod +x /usr/bin/su-exec && \
echo "${GOMPLATE_CHECKSUM} /usr/bin/gomplate" | sha256sum -c - && \
chmod +x /usr/bin/gomplate

RUN yum install -y \
ca-certificates \
bash \
vim \
curl \
wget \
procps-ng \
apt-utils \
iputils \
bzip2 \
unzip \
cronie \
git-core \
sshpass \
tree \
jq \
gnupg2 \
nss_wrapper \
&& yum autoremove -y \
&& yum clean all

COPY ./overlay /
CMD ["bash"]

# Dependencies for building desktop-client
RUN yum install -y \
langpacks-en \
clang \
clazy \
ninja-build \
cmake \
extra-cmake-modules \
pkgconf-pkg-config \
zlib-devel \
libsqlite3x-devel \
openssl-devel \
libcmocka-devel \
qt5-qtbase-devel \
qt5-qttools-devel \
libcloudproviders-devel \
qtkeychain-qt5-devel \
kf5-kio-devel \
&& yum autoremove -y \
&& yum clean all
6 changes: 6 additions & 0 deletions fedora/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
image: owncloudci/client:fedora
manifests:
- image: owncloudci/client:fedora-amd64
platform:
architecture: amd64
os: linux
69 changes: 69 additions & 0 deletions fedora/overlay/etc/bash.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
if [ -z "$PS1" ]
then
return
fi

export EDITOR="vim"
export PAGER="less"
export CLICOLOR="1"
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export GREP_COLOR="1;32"
export IGNOREEOF="0"
export HISTSIZE="100000"
export HISTFILESIZE="100000"
export HISTCONTROL="ignoreboth"

shopt -s cmdhist
shopt -s checkwinsize
shopt -s histappend
shopt -s cdspell

complete -c command type which
complete -d cd
complete -cf sudo

alias vi="vim"
alias ls="ls --color=auto"
alias lsa="ls -lahi"
alias l="ls -la"
alias ll="ls -alFh"
alias ..="cd .."
alias ...="cd ../.."
alias grep="grep --color=auto"
alias rgrep="grep -rn"
alias history="fc -l 1"

if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
function command_not_found_handle {
if [ -x /usr/lib/command-not-found ]
then
/usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]
then
/usr/share/command-not-found/command-not-found -- "$1"
return $?
else
printf "%s: command not found\n" "$1" >&2
return 127
fi
}
fi

bash_prompt() {
local NONE="\[\033[0m\]"

local U="\[\033[01;32m\]"
local R="\[\033[01;31m\]"
local S="\[\033[01;37m\]"
local H="\[\033[01;35m\]"
local D="\[\033[01;34m\]"

if [[ "${EUID}" == "0" ]] ; then
export PS1="\n$R\u$S@$H\h: $D\w # $NONE"
else
export PS1="\n$U\u$S@$H\h: $D\w # $NONE"
fi
}

bash_prompt && unset bash_prompt
20 changes: 20 additions & 0 deletions fedora/overlay/etc/inputrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[7~": beginning-of-line
"\e[8~": end-of-line
"\eOH": beginning-of-line
"\eOF": end-of-line
"\e[H": beginning-of-line
"\e[F": end-of-line

"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\eOC": forward-word
"\eOD": backward-word
"\eOc": forward-word
"\eOd": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

"\e[5~": history-search-backward
"\e[6~": history-search-forward
101 changes: 101 additions & 0 deletions fedora/overlay/etc/vim/vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
" filetype config {
filetype plugin on
filetype indent on
"}

" misc stuff {
set nocompatible
set modeline
set history=1000
set backspace=indent,eol,start
set selection=inclusive
set completeopt=longest,menu,preview
set diffopt+=vertical
set autoread
"}

" tab related {
set shiftwidth=2
set tabstop=2
set expandtab
set smarttab
set cindent
"}

" status related {
set ruler
set showcmd
set nonumber
set shortmess=aoOtTI
set laststatus=1
"}

" search related {
set hlsearch
set incsearch
set ignorecase
set smartcase
set scrolloff=3
set sidescrolloff=5
"}

" encoding related {
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
set fileencodings=utf-8,latin1,default
"}

" bell related {
set noerrorbells
set vb t_vb=
"}

" backup related {
set nobackup
"}

" swap related {
set swapfile
"}

" grep related {
set grepprg=grep\ -nH\ $*
"}

" folding related {
set foldcolumn=0
set foldmethod=indent
set foldnestmax=100
set nofoldenable
set foldlevel=1
"}

" coloring related {
set background=dark
set t_Co=256
"}

" show syntax {
syntax on
"}

" select scheme {
colorscheme delek
"}

" folding mapping {
map <F5> zo
map <F6> zc
map <F7> zR
map <F8> zM
"}

" switch tabs {
map <F9> gT
map <F10> gt
"}

" paste switch {
set pastetoggle=<F11>
"}
Loading

0 comments on commit 660c5b2

Please sign in to comment.