Skip to content

Commit ccb1a51

Browse files
committed
#8 Adding container image with microcks-cli
1 parent 03f2852 commit ccb1a51

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

build-binaries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ do
2020
output_name+='.exe'
2121
fi
2222

23-
env GOOS=$GOOS GOARCH=$GOARCH go build -o $output_name $package
23+
env GOOS=$GOOS GOARCH=$GOARCH go build -o ./build/_output/$output_name $package
2424
if [ $? -ne 0 ]; then
2525
echo 'An error has occurred! Aborting the script execution...'
2626
exit 1

build/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
2+
3+
MAINTAINER Laurent Broudoux <[email protected]>
4+
5+
ENV CLI=/usr/local/bin/microcks-cli \
6+
USER_UID=1001 \
7+
USER_NAME=microcks-cli
8+
9+
# install cli binary
10+
COPY /build/_output/microcks-cli-linux-amd64 ${CLI}
11+
12+
COPY build/bin /usr/local/bin
13+
RUN /usr/local/bin/user_setup
14+
15+
USER ${USER_UID}

build/bin/user_setup

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
set -x
3+
4+
# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
5+
mkdir -p ${HOME}
6+
chown ${USER_UID}:0 ${HOME}
7+
chmod ug+rwx ${HOME}
8+
9+
# runtime user will need to be able to self-insert in /etc/passwd
10+
chmod g+rw /etc/passwd
11+
12+
# no need for this script to remain in the image after running
13+
rm $0

0 commit comments

Comments
 (0)