Last active
May 22, 2016 14:36
-
-
Save takaya030/28ab12db713146a1ef011c9a23e73708 to your computer and use it in GitHub Desktop.
Docker ubuntu image with Google Cloud SDK
This file contains hidden or 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
# gcloud shell | |
# | |
FROM python:2.7 | |
MAINTAINER takaya030 | |
RUN apt-get update && apt-get install -y openssh-server sudo | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:root' | chpasswd | |
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
ENV NOTVISIBLE "in users profile" | |
RUN echo "export VISIBLE=now" >> /etc/profile | |
# create login user | |
RUN useradd -d /home/gcp -m -s /bin/bash gcp | |
RUN echo gcp:****gcp | chpasswd | |
RUN echo 'gcp ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd", "-D"] |
This file contains hidden or 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
{ | |
"id": "nginx", | |
"kind": "Pod", | |
"apiVersion": "v1", | |
"desiredState": { | |
"manifest": { | |
"version": "v1", | |
"containers": [{ | |
"name": "nginx", | |
"image": "gcr.io/your-project-id/nginx", | |
"ports": [{ | |
"containerPort": 80, | |
"hostPort": 80 | |
}] | |
}] | |
} | |
}, | |
"labels": { | |
"name": "nginx" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment