forked from oracle-devrel/cd3-automation-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (22 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM oraclelinux:7-slim
LABEL maintainer="Team at Oracle"
LABEL description="OCI format to generate CD3 image"
ARG USERNAME=cd3user
ARG USER_UID=1001
ARG USER_GID=$USER_UID
RUN yum install sudo -y && groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -d /$USERNAME -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& mkdir /cd3user/tenancies/ && sudo chown -R $USERNAME:$USERNAME /cd3user/tenancies/
USER $USERNAME
WORKDIR /cd3user/oci_tools/
COPY . .
RUN sudo yum install -y oracle-softwarecollection-release-el7 \
&& sudo chown -R $USERNAME:$USERNAME /cd3user/
WORKDIR /cd3user/
RUN sudo sed -i -e 's/\r$//' /cd3user/oci_tools/cd3_automation_toolkit/shell_script.sh \
&& bash /cd3user/oci_tools/cd3_automation_toolkit/shell_script.sh \
&& sudo chown -R cd3user:cd3user /cd3user/ && sudo yum clean all && sudo rm -rf /var/cache/yum /root/ocswork \
&& sudo rm -rf /cd3user/oci_tools/Dockerfile && sudo rm -rf /cd3user/oci_tools/Readme.md \
&& sudo rm -rf /cd3user/oci_tools/.git && sudo rm -rf /cd3user/oci_tools/.gitignore && sudo chmod -R 740 /cd3user/