Change containerDir path as /var/run is a special directory
This commit is contained in:
@@ -265,21 +265,21 @@ type CreateContainerOpts struct {
|
|||||||
|
|
||||||
func (d *docker) ContainerCreate(opts CreateContainerOpts) (err error) {
|
func (d *docker) ContainerCreate(opts CreateContainerOpts) (err error) {
|
||||||
// Make sure directories are available for the new instance container
|
// Make sure directories are available for the new instance container
|
||||||
containerDir := "/var/run/pwd"
|
containerDir := "/opt/pwd"
|
||||||
containerCertDir := fmt.Sprintf("%s/certs", containerDir)
|
containerCertDir := fmt.Sprintf("%s/certs", containerDir)
|
||||||
|
|
||||||
env := []string{fmt.Sprintf("SESSION_ID=%s", opts.SessionId)}
|
env := []string{fmt.Sprintf("SESSION_ID=%s", opts.SessionId)}
|
||||||
|
|
||||||
// Write certs to container cert dir
|
// Write certs to container cert dir
|
||||||
if len(opts.ServerCert) > 0 {
|
if len(opts.ServerCert) > 0 {
|
||||||
env = append(env, `DOCKER_TLSCERT=\/var\/run\/pwd\/certs\/cert.pem`)
|
env = append(env, `DOCKER_TLSCERT=\/opt\/pwd\/certs\/cert.pem`)
|
||||||
}
|
}
|
||||||
if len(opts.ServerKey) > 0 {
|
if len(opts.ServerKey) > 0 {
|
||||||
env = append(env, `DOCKER_TLSKEY=\/var\/run\/pwd\/certs\/key.pem`)
|
env = append(env, `DOCKER_TLSKEY=\/opt\/pwd\/certs\/key.pem`)
|
||||||
}
|
}
|
||||||
if len(opts.CACert) > 0 {
|
if len(opts.CACert) > 0 {
|
||||||
// if ca cert is specified, verify that clients that connects present a certificate signed by the CA
|
// if ca cert is specified, verify that clients that connects present a certificate signed by the CA
|
||||||
env = append(env, `DOCKER_TLSCACERT=\/var\/run\/pwd\/certs\/ca.pem`)
|
env = append(env, `DOCKER_TLSCACERT=\/opt\/pwd\/certs\/ca.pem`)
|
||||||
}
|
}
|
||||||
if len(opts.ServerCert) > 0 || len(opts.ServerKey) > 0 || len(opts.CACert) > 0 {
|
if len(opts.ServerCert) > 0 || len(opts.ServerKey) > 0 || len(opts.CACert) > 0 {
|
||||||
// if any of the certs is specified, enable TLS
|
// if any of the certs is specified, enable TLS
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
ARG VERSION=franela/docker:17.06.2-dind-ubuntu
|
ARG VERSION=franela/docker:18.01-dind-ubuntu
|
||||||
FROM ${VERSION}
|
FROM ${VERSION}
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y git tmux apache2-utils vim curl jq bash-completion \
|
&& apt-get install -y git tmux apache2-utils vim curl jq bash-completion tree zip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Add kubectl client
|
||||||
# Add bash completion and set bash as default shell
|
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.6/bin/linux/amd64/kubectl \
|
||||||
#RUN mkdir /etc/bash_completion.d \
|
&& chmod +x ./kubectl \
|
||||||
# && curl https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker -o /etc/bash_completion.d/docker \
|
&& mv ./kubectl /usr/local/bin/kubectl
|
||||||
# && sed -i "s/ash/bash/" /etc/passwd
|
|
||||||
|
|
||||||
|
|
||||||
# Install a nice vimrc file and prompt (by soulshake)
|
# Install a nice vimrc file and prompt (by soulshake)
|
||||||
COPY ["docker-prompt", "sudo", "ucp.sh", "/usr/local/bin/"]
|
COPY ["docker-prompt", "sudo", "ucp-beta.sh", "/usr/local/bin/"]
|
||||||
COPY [".vimrc",".profile", ".inputrc", ".gitconfig", "workshop.lic", "./root/"]
|
COPY [".vimrc",".profile", ".inputrc", ".gitconfig", "workshop_beta.lic", "./root/"]
|
||||||
COPY ["motd", "/etc/motd"]
|
COPY ["motd", "/etc/motd"]
|
||||||
COPY ["ee/daemon.json", "/etc/docker/"]
|
COPY ["ee/daemon.json", "/etc/docker/"]
|
||||||
COPY ["ee/cert.pem", "/var/run/pwd/certs/"]
|
COPY ["ee/cert.pem", "/opt/pwd/certs/"]
|
||||||
COPY ["ee/key.pem", "/var/run/pwd/certs/"]
|
COPY ["ee/key.pem", "/opt/pwd/certs/"]
|
||||||
|
COPY ["ee/config.json", "/root/.docker/"]
|
||||||
|
|
||||||
# Move to our home
|
# Move to our home
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
# Setup certs and uploads folders
|
# Setup certs and uploads folders
|
||||||
RUN mkdir -p /var/run/pwd/certs && mkdir -p /var/run/pwd/uploads
|
RUN mkdir -p /opt/pwd/certs /opt/pwd/uploads /var/lib/kubelet
|
||||||
|
|
||||||
# Remove IPv6 alias for localhost and start docker in the background ...
|
# Remove IPv6 alias for localhost and start docker in the background ...
|
||||||
CMD cat /etc/hosts >/etc/hosts.bak && \
|
CMD cat /etc/hosts >/etc/hosts.bak && \
|
||||||
@@ -35,6 +35,8 @@ CMD cat /etc/hosts >/etc/hosts.bak && \
|
|||||||
sed -i "s/\DOCKER_TLSCERT/$DOCKER_TLSCERT/" /etc/docker/daemon.json && \
|
sed -i "s/\DOCKER_TLSCERT/$DOCKER_TLSCERT/" /etc/docker/daemon.json && \
|
||||||
sed -i "s/\DOCKER_TLSKEY/$DOCKER_TLSKEY/" /etc/docker/daemon.json && \
|
sed -i "s/\DOCKER_TLSKEY/$DOCKER_TLSKEY/" /etc/docker/daemon.json && \
|
||||||
mount -t securityfs none /sys/kernel/security && \
|
mount -t securityfs none /sys/kernel/security && \
|
||||||
|
mount --make-shared -t tmpfs tmpfs /run && \
|
||||||
|
mount --make-shared -t tmpfs tmpfs /var/lib/kubelet && \
|
||||||
dockerd > /docker.log 2>&1 & \
|
dockerd > /docker.log 2>&1 & \
|
||||||
while true ; do script -q -c "/bin/bash -l" /dev/null ; done
|
while true ; do script -q -c "/bin/bash -l" /dev/null ; done
|
||||||
# ... and then put a shell in the foreground, restarting it if it exits
|
# ... and then put a shell in the foreground, restarting it if it exits
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"insecure-registries": ["127.0.0.1"],
|
"insecure-registries": ["127.0.0.1"],
|
||||||
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2376"],
|
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2376"],
|
||||||
"tls": true,
|
"tls": true,
|
||||||
"tlscert": "/var/run/pwd/certs/cert.pem",
|
"tlscert": "/opt/pwd/certs/cert.pem",
|
||||||
"tlskey": "/var/run/pwd/certs/key.pem"
|
"tlskey": "/opt/pwd/certs/key.pem"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -443,7 +443,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.openEditor = function(instance) {
|
$scope.openEditor = function(instance) {
|
||||||
console.log(instance);
|
|
||||||
var w = window.screen.availWidth * 45 / 100;
|
var w = window.screen.availWidth * 45 / 100;
|
||||||
var h = window.screen.availHeight * 45 / 100;
|
var h = window.screen.availHeight * 45 / 100;
|
||||||
$window.open('/sessions/' + instance.session_id + '/instances/'+instance.name+'/editor', 'editor',
|
$window.open('/sessions/' + instance.session_id + '/instances/'+instance.name+'/editor', 'editor',
|
||||||
|
|||||||
Reference in New Issue
Block a user