File tree 6 files changed +92
-17
lines changed
6 files changed +92
-17
lines changed Original file line number Diff line number Diff line change 1
- # chef-setup-docker
2
- Docker compose for running Codebox Web IDE and ansible.
1
+ # codespace-chef-setup
3
2
3
+ Docker compose for running Codebox Web IDE and chef
4
4
5
- Create a Mount directory in docker host for Workspace
6
5
7
- - /mnt/codebox
6
+ change the directory
7
+ - /codebox
8
8
9
9
Run the Docker Compose
10
-
10
+
11
11
- docker-compose up -d
12
12
13
13
Access Credentials
14
14
15
- - http://ip
15
+ - http://ip:8000
16
16
17
- - username: admin
18
- - password: standard_ic_pass
17
+ - username: devops
18
+ - password: codespaces
Original file line number Diff line number Diff line change
1
+ {
2
+ "variables" : {
3
+ "aws_access_key" : " $akey" ,
4
+ "aws_secret_key" : " $skey"
5
+ },
6
+ "builders" : [{
7
+ "type" : " amazon-ebs" ,
8
+ "access_key" : " {{user `aws_access_key`}}" ,
9
+ "secret_key" : " {{user `aws_secret_key`}}" ,
10
+ "region" : " us-east-1" ,
11
+ "source_ami" : " ami-e13739f6" ,
12
+ "instance_type" : " t2.micro" ,
13
+ "ssh_username" : " ubuntu" ,
14
+ "ami_name" : " chef-codespace"
15
+ }],
16
+ "provisioners" : [
17
+ {
18
+ "type" : " file" ,
19
+ "source" : " ../docker-compose.yml" ,
20
+ "destination" : " /tmp/docker-compose.yml"
21
+ },
22
+ {
23
+ "type" : " shell" ,
24
+ "scripts" : [
25
+ " script/update.sh" ,
26
+ " script/custom-script.sh"
27
+ ]
28
+ }
29
+ ]
30
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eux
4
+
5
+ # Sample custom configuration script - add your own commands here
6
+ # to add some additional commands for your environment
7
+ #
8
+ # For example:
9
+ # yum install -y curl wget git tmux firefox xvfb
10
+ sudo su
11
+
12
+ echo " Installing Docker"
13
+ # Installing Docker
14
+ sudo apt-get update -y
15
+ sudo apt-get install apt-transport-https ca-certificates -y
16
+ sudo apt-key adv \
17
+ --keyserver hkp://ha.pool.sks-keyservers.net:80 \
18
+ --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
19
+ echo " deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
20
+ sudo apt-get update -y
21
+ sudo apt-get install linux-image-extra-$( uname -r) linux-image-extra-virtual -y
22
+ sudo apt-get install docker-engine -y
23
+ sudo usermod -aG docker ubuntu
24
+ sudo service docker start
25
+
26
+ echo " Installing emacs git tree bzip2 ntp telnet inetutils-traceroute nmap"
27
+ # Installing emacs git tree bzip2 ntp telnet inetutils-traceroute nmap
28
+ sudo apt-get install -y emacs git tree bzip2 ntp telnet inetutils-traceroute nmap
29
+
30
+ echo " Installing Docker-compose"
31
+ # Installing Docker-compose
32
+ sudo curl -L " https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$( uname -s) -$( uname -m) " -o /usr/bin/docker-compose
33
+
34
+ sudo chmod +x /usr/bin/docker-compose
35
+
36
+ echo " copying codespace code"
37
+ # copying codespace code
38
+ sudo mkdir -p /codespace
39
+ sudo cp /tmp/* .yml /codespace/
40
+
41
+ echo " starting containers"
42
+ cd /codespace && sudo docker-compose up -d && touch /tmp/test-` date " +%H:%M:%S" `
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eux
2
+
3
+ sleep 30
4
+
5
+ echo " ==> Updating list of repositories"
6
+ # apt-get update does not actually perform updates, it just downloads and indexes the list of packages
7
+ sudo apt-get -y update
Original file line number Diff line number Diff line change @@ -31,17 +31,14 @@ curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compos
31
31
32
32
chmod +x /usr/bin/docker-compose
33
33
34
- echo " Downloading docker images"
35
- # docker pull ubuntu:16.04
36
- docker pull schoolofdevops/chef-controller:v1.2.0
37
- docker pull schoolofdevops/chef-centos6-node:v1.1
38
- # docker pull schoolofdevops/chef-ubuntu14-node:v1.1
39
-
40
34
echo " copying codespace code"
41
35
# copying codespace code
42
36
mkdir -p /codespace
43
37
cp /tmp/* .yml /codespace/
44
38
39
+ echo " starting containers"
40
+ cd /codespace && sudo docker-compose up -d && touch /tmp/test-` date " +%H:%M:%S" `
41
+
45
42
echo " modifying in rc.local"
46
43
# modifying in rc.local
47
44
cat << EOF > /etc/rc.local
Original file line number Diff line number Diff line change 108
108
" passwd/user-password={{ user `ssh_password` }} " ,
109
109
" passwd/user-password-again={{ user `ssh_password` }} " ,
110
110
" passwd/username={{ user `ssh_username` }} " ,
111
- " initrd=/install/initrd.gz -- <wait><enter>"
111
+ " initrd=/install/initrd.gz -- <wait><enter>"
112
112
],
113
113
"disk_size" : " {{ user `disk_size` }}" ,
114
114
"floppy_files" : [
143
143
],
144
144
"post-processors" : [
145
145
{
146
- "keep_input_artifact" : false ,
146
+ "keep_input_artifact" : true ,
147
147
"output" : " box/{{.Provider}}/{{user `vm_name`}}-{{user `version`}}.box" ,
148
148
"type" : " vagrant" ,
149
149
"vagrantfile_template" : " {{ user `vagrantfile_template` }}"
221
221
"vmware_guest_os_type" : " ubuntu-64"
222
222
}
223
223
}
224
-
You can’t perform that action at this time.
0 commit comments