-
Notifications
You must be signed in to change notification settings - Fork 60
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
switch to ubuntu 22.04 #70
Open
MarvAmBass
wants to merge
1
commit into
ServerContainers:master
Choose a base branch
from
martijndierckx:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,11 @@ | ||
#!/bin/sh -x | ||
#!/bin/sh | ||
|
||
IMG="servercontainers/samba" | ||
IMG="martijndierckx/samba" | ||
PLATFORM="linux/amd64" | ||
|
||
PLATFORM="linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6" | ||
UBUNTU_VERSION=22.04 | ||
|
||
rm -rf variants.tar variants/ 2>/dev/null >/dev/null | ||
SAMBA_V_OUPUT=$(docker run --rm -ti ubuntu:22.04 /bin/bash -c "apt -qq update 2> /dev/null && apt show samba 2> /dev/null") | ||
SAMBA_VERSION=$(echo "$SAMBA_V_OUPUT" | grep "Version: " | grep "[0-9]:[0-9\.]\+" -o | sed "s/[0-9]://g") | ||
|
||
if [ -z ${SAMBA_VERSION+x} ] || [ -z ${ALPINE_VERSION+x} ]; then | ||
docker-compose build -q --pull --no-cache | ||
export SAMBA_VERSION=$(docker run --rm -ti "$IMG" apk list 2>/dev/null | grep '\[installed\]' | grep "samba-[0-9]" | cut -d " " -f1 | sed 's/samba-//g' | tr -d '\r') | ||
export ALPINE_VERSION=$(docker run --rm -ti "$IMG" cat /etc/alpine-release | tail -n1 | tr -d '\r') | ||
fi | ||
|
||
if echo "$@" | grep -v "force" 2>/dev/null >/dev/null; then | ||
echo "check if image was already build and pushed - skip check on release version" | ||
echo "$@" | grep -v "release" && docker pull "$IMG:a$ALPINE_VERSION-s$SAMBA_VERSION" 2>/dev/null >/dev/null && echo "image already build" && exit 1 | ||
fi | ||
|
||
docker buildx build -q --pull --no-cache --platform "$PLATFORM" -t "$IMG:a$ALPINE_VERSION-s$SAMBA_VERSION" --push . | ||
|
||
echo "$@" | grep "release" 2>/dev/null >/dev/null && echo ">> releasing new latest" && docker buildx build -q --pull --platform "$PLATFORM" -t "$IMG:latest" --push . | ||
|
||
# make sure this is only executed in main script | ||
echo "$@" | grep "variant" && exit 0 | ||
|
||
|
||
tar cf variants.tar --exclude .git/ --exclude variants.tar . | ||
|
||
mkdir -p variants/smbd-only variants/smbd-avahi variants/smbd-wsdd2 | ||
|
||
|
||
cd variants/smbd-only | ||
tar xf ../../variants.tar | ||
cat Dockerfile | grep -v avahi | grep -v wsdd2 > Dockerfile.new | ||
mv Dockerfile.new Dockerfile | ||
rm -rf config/avahi config/runit/avahi | ||
rm -rf config/runit/wsdd2 | ||
|
||
sed -i.bak 's/:[a]/:smbd-only-a/g' build.sh && rm build.sh.bak | ||
sed -i.bak 's/:[l]atest/:smbd-only-latest/g' build.sh && rm build.sh.bak | ||
|
||
./build.sh "variant" "$@" | ||
|
||
cd ../../ | ||
|
||
|
||
cd variants/smbd-avahi | ||
tar xf ../../variants.tar | ||
cat Dockerfile | grep -v wsdd2 > Dockerfile.new | ||
mv Dockerfile.new Dockerfile | ||
rm -rf config/runit/wsdd2 | ||
|
||
sed -i.bak 's/:[a]/:smbd-avahi-a/g' build.sh && rm build.sh.bak | ||
sed -i.bak 's/:[l]atest/:smbd-avahi-latest/g' build.sh && rm build.sh.bak | ||
|
||
./build.sh "variant" "$@" | ||
|
||
cd ../../ | ||
|
||
|
||
cd variants/smbd-wsdd2 | ||
tar xf ../../variants.tar | ||
cat Dockerfile | grep -v avahi > Dockerfile.new | ||
mv Dockerfile.new Dockerfile | ||
rm -rf config/avahi config/runit/avahi | ||
|
||
sed -i.bak 's/:[a]/:smbd-wsdd2-a/g' build.sh && rm build.sh.bak | ||
sed -i.bak 's/:[l]atest/:smbd-wsdd2-latest/g' build.sh && rm build.sh.bak | ||
|
||
./build.sh "variant" "$@" | ||
|
||
cd ../../ | ||
docker buildx build --push --platform "$PLATFORM" --tag "$IMG:$SAMBA_VERSION" --tag "$IMG:latest" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarvAmBass, you might want to update the healthcheck to
smbclient -L //localhost -U %
. I suggest to remove-m SMB3
, as the user might disable SMBv3.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, but I didn't use smbclient for healthchecking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I just wanted to suggest to use it. YMMV 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, it thought the same, that it's a bit better than my current healthcheck - I'll think about it :)