File tree 2 files changed +41
-10
lines changed
2 files changed +41
-10
lines changed Original file line number Diff line number Diff line change 18
18
- name : " Linux build"
19
19
os : linux
20
20
dist : trusty
21
- env : TARGET="linux"
21
+ env : TARGET="linux" PUSH_DOCKER="true"
22
22
if : tag IS blank
23
23
script : scripts/ci.bash
24
24
- name : " Alpine build"
31
31
os : osx
32
32
if : tag IS blank
33
33
script : travis_wait 40 scripts/ci.bash
34
- - name : " Docker build"
35
- os : linux
36
- dist : trusty
37
- env : DOCKER_BUILD="true"
38
- if : branch == master AND tag IS blank
39
- script : docker build --build-arg githubToken="$GITHUB_TOKEN" --build-arg codeServerVersion="$VERSION" --build-arg vscodeVersion="$VSCODE_VERSION" -t codercom/code-server:"$TAG" -t codercom/code-server:v2 .
40
34
41
35
git :
42
36
depth : 3
@@ -46,7 +40,7 @@ before_deploy:
46
40
- git config --local user.name "$USER_NAME"
47
41
- git config --local user.email "$USER_EMAIL"
48
42
- if ! git tag "$TAG" "$TRAVIS_COMMIT" ; then echo "$TAG already exists"; fi
49
- - if [[ -n "$DOCKER_BUILD " ]] ; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; fi
43
+ - if [[ -n "$PUSH_DOCKER " ]] ; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; fi
50
44
51
45
deploy :
52
46
- provider : releases
@@ -67,11 +61,11 @@ deploy:
67
61
68
62
- provider : script
69
63
skip_cleanup : true
70
- script : docker push codercom/code-server:"$TAG" ; docker push codercom/code-server:v2
64
+ script : docker build -f ./scripts/ci.dockerfile --build-arg -t codercom/code-server:"$TAG" -t codercom/code-server:v2 . && docker push codercom/code-server:"$TAG" && docker push codercom/code-server:v2
71
65
on :
72
66
repo : cdr/code-server
73
67
branch : master
74
- condition : -n "$DOCKER_BUILD "
68
+ condition : -n "$PUSH_DOCKER "
75
69
76
70
cache :
77
71
yarn : true
Original file line number Diff line number Diff line change
1
+ # We deploy with ubuntu so that devs have a familiar environment.
2
+ FROM ubuntu:18.04
3
+
4
+ RUN apt-get update && apt-get install -y \
5
+ openssl \
6
+ net-tools \
7
+ git \
8
+ locales \
9
+ sudo \
10
+ dumb-init \
11
+ vim \
12
+ curl \
13
+ wget
14
+
15
+ RUN locale-gen en_US.UTF-8
16
+ # We cannot use update-locale because docker will not use the env variables
17
+ # configured in /etc/default/locale so we need to set it manually.
18
+ ENV LC_ALL=en_US.UTF-8
19
+
20
+ RUN adduser --gecos '' --disabled-password coder && \
21
+ echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
22
+
23
+ USER coder
24
+ # We create first instead of just using WORKDIR as when WORKDIR creates, the
25
+ # user is root.
26
+ RUN mkdir -p /home/coder/project
27
+
28
+ WORKDIR /home/coder/project
29
+
30
+ # This ensures we have a volume mounted even if the user forgot to do bind
31
+ # mount. So that they do not lose their data if they delete the container.
32
+ VOLUME [ "/home/coder/project" ]
33
+
34
+ COPY ./binaries/code-server* /usr/local/bin/code-server
35
+ EXPOSE 8080
36
+
37
+ ENTRYPOINT ["dumb-init" , "code-server" , "--host" , "0.0.0.0" ]
You can’t perform that action at this time.
0 commit comments