Skip to content
Snippets Groups Projects

CMSC417 Spring 2023 Docker Setup Guide

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by David Dongwook Kim
    Edited
    417setup.html 25.57 KiB
    <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>417 - Welcome &amp; where to start</title><style>
    /* cspell:disable-file */
    /* webkit printing magic: print all background colors */
    html {
    	-webkit-print-color-adjust: exact;
    }
    * {
    	box-sizing: border-box;
    	-webkit-print-color-adjust: exact;
    }
    
    html,
    body {
    	margin: 0;
    	padding: 0;
    }
    @media only screen {
    	body {
    		margin: 2em auto;
    		max-width: 900px;
    		color: rgb(55, 53, 47);
    	}
    }
    
    body {
    	line-height: 1.5;
    	white-space: pre-wrap;
    }
    
    a,
    a.visited {
    	color: inherit;
    	text-decoration: underline;
    }
    
    .pdf-relative-link-path {
    	font-size: 80%;
    	color: #444;
    }
    
    h1,
    h2,
    h3 {
    	letter-spacing: -0.01em;
    	line-height: 1.2;
    	font-weight: 600;
    	margin-bottom: 0;
    }
    
    .page-title {
    	font-size: 2.5rem;
    	font-weight: 700;
    	margin-top: 0;
    	margin-bottom: 0.75em;
    }
    
    h1 {
    	font-size: 1.875rem;
    	margin-top: 1.875rem;
    }
    
    h2 {
    	font-size: 1.5rem;
    	margin-top: 1.5rem;
    }
    
    h3 {
    	font-size: 1.25rem;
    	margin-top: 1.25rem;
    }
    
    .source {
    	border: 1px solid #ddd;
    	border-radius: 3px;
    	padding: 1.5em;
    	word-break: break-all;
    }
    
    .callout {
    	border-radius: 3px;
    	padding: 1rem;
    }
    
    figure {
    	margin: 1.25em 0;
    	page-break-inside: avoid;
    }
    
    figcaption {
    	opacity: 0.5;
    	font-size: 85%;
    	margin-top: 0.5em;
    }
    
    mark {
    	background-color: transparent;
    }
    
    .indented {
    	padding-left: 1.5em;
    }
    
    hr {
    	background: transparent;
    	display: block;
    	width: 100%;
    	height: 1px;
    	visibility: visible;
    	border: none;
    	border-bottom: 1px solid rgba(55, 53, 47, 0.09);
    }
    
    img {
    	max-width: 100%;
    }
    
    @media only print {
    	img {
    		max-height: 100vh;
    		object-fit: contain;
    	}
    }
    
    @page {
    	margin: 1in;
    }
    
    .collection-content {
    	font-size: 0.875rem;
    }
    
    .column-list {
    	display: flex;
    	justify-content: space-between;
    }
    
    .column {
    	padding: 0 1em;
    }
    
    .column:first-child {
    	padding-left: 0;
    }
    
    .column:last-child {
    	padding-right: 0;
    }
    
    .table_of_contents-item {
    	display: block;
    	font-size: 0.875rem;
    	line-height: 1.3;
    	padding: 0.125rem;
    }
    
    .table_of_contents-indent-1 {
    	margin-left: 1.5rem;
    }
    
    .table_of_contents-indent-2 {
    	margin-left: 3rem;
    }
    
    .table_of_contents-indent-3 {
    	margin-left: 4.5rem;
    }
    
    .table_of_contents-link {
    	text-decoration: none;
    	opacity: 0.7;
    	border-bottom: 1px solid rgba(55, 53, 47, 0.18);
    }
    
    table,
    th,
    td {
    	border: 1px solid rgba(55, 53, 47, 0.09);
    	border-collapse: collapse;
    }
    
    table {
    	border-left: none;
    	border-right: none;
    }
    
    th,
    td {
    	font-weight: normal;
    	padding: 0.25em 0.5em;
    	line-height: 1.5;
    	min-height: 1.5em;
    	text-align: left;
    }
    
    th {
    	color: rgba(55, 53, 47, 0.6);
    }
    
    ol,
    ul {
    	margin: 0;
    	margin-block-start: 0.6em;
    	margin-block-end: 0.6em;
    }
    
    li > ol:first-child,
    li > ul:first-child {
    	margin-block-start: 0.6em;
    }
    
    ul > li {
    	list-style: disc;
    }
    
    ul.to-do-list {
    	text-indent: -1.7em;
    }
    
    ul.to-do-list > li {
    	list-style: none;
    }
    
    .to-do-children-checked {
    	text-decoration: line-through;
    	opacity: 0.375;
    }
    
    ul.toggle > li {
    	list-style: none;
    }
    
    ul {
    	padding-inline-start: 1.7em;
    }
    
    ul > li {
    	padding-left: 0.1em;
    }
    
    ol {
    	padding-inline-start: 1.6em;
    }
    
    ol > li {
    	padding-left: 0.2em;
    }
    
    .mono ol {
    	padding-inline-start: 2em;
    }
    
    .mono ol > li {
    	text-indent: -0.4em;
    }
    
    .toggle {
    	padding-inline-start: 0em;
    	list-style-type: none;
    }
    
    /* Indent toggle children */
    .toggle > li > details {
    	padding-left: 1.7em;
    }
    
    .toggle > li > details > summary {
    	margin-left: -1.1em;
    }
    
    .selected-value {
    	display: inline-block;
    	padding: 0 0.5em;
    	background: rgba(206, 205, 202, 0.5);
    	border-radius: 3px;
    	margin-right: 0.5em;
    	margin-top: 0.3em;
    	margin-bottom: 0.3em;
    	white-space: nowrap;
    }
    
    .collection-title {
    	display: inline-block;
    	margin-right: 1em;
    }
    
    .simple-table {
    	margin-top: 1em;
    	font-size: 0.875rem;
    	empty-cells: show;
    }
    .simple-table td {
    	height: 29px;
    	min-width: 120px;
    }
    
    .simple-table th {
    	height: 29px;
    	min-width: 120px;
    }
    
    .simple-table-header-color {
    	background: rgb(247, 246, 243);
    	color: black;
    }
    .simple-table-header {
    	font-weight: 500;
    }
    
    time {
    	opacity: 0.5;
    }
    
    .icon {
    	display: inline-block;
    	max-width: 1.2em;
    	max-height: 1.2em;
    	text-decoration: none;
    	vertical-align: text-bottom;
    	margin-right: 0.5em;
    }
    
    img.icon {
    	border-radius: 3px;
    }
    
    .user-icon {
    	width: 1.5em;
    	height: 1.5em;
    	border-radius: 100%;
    	margin-right: 0.5rem;
    }
    
    .user-icon-inner {
    	font-size: 0.8em;
    }
    
    .text-icon {
    	border: 1px solid #000;
    	text-align: center;
    }
    
    .page-cover-image {
    	display: block;
    	object-fit: cover;
    	width: 100%;
    	max-height: 30vh;
    }
    
    .page-header-icon {
    	font-size: 3rem;
    	margin-bottom: 1rem;
    }
    
    .page-header-icon-with-cover {
    	margin-top: -0.72em;
    	margin-left: 0.07em;
    }
    
    .page-header-icon img {
    	border-radius: 3px;
    }
    
    .link-to-page {
    	margin: 1em 0;
    	padding: 0;
    	border: none;
    	font-weight: 500;
    }
    
    p > .user {
    	opacity: 0.5;
    }
    
    td > .user,
    td > time {
    	white-space: nowrap;
    }
    
    input[type="checkbox"] {
    	transform: scale(1.5);
    	margin-right: 0.6em;
    	vertical-align: middle;
    }
    
    p {
    	margin-top: 0.5em;
    	margin-bottom: 0.5em;
    }
    
    .image {
    	border: none;
    	margin: 1.5em 0;
    	padding: 0;
    	border-radius: 0;
    	text-align: center;
    }
    
    .code,
    code {
    	background: rgba(135, 131, 120, 0.15);
    	border-radius: 3px;
    	padding: 0.2em 0.4em;
    	border-radius: 3px;
    	font-size: 85%;
    	tab-size: 2;
    }
    
    code {
    	color: #eb5757;
    }
    
    .code {
    	padding: 1.5em 1em;
    }
    
    .code-wrap {
    	white-space: pre-wrap;
    	word-break: break-all;
    }
    
    .code > code {
    	background: none;
    	padding: 0;
    	font-size: 100%;
    	color: inherit;
    }
    
    blockquote {
    	font-size: 1.25em;
    	margin: 1em 0;
    	padding-left: 1em;
    	border-left: 3px solid rgb(55, 53, 47);
    }
    
    .bookmark {
    	text-decoration: none;
    	max-height: 8em;
    	padding: 0;
    	display: flex;
    	width: 100%;
    	align-items: stretch;
    }
    
    .bookmark-title {
    	font-size: 0.85em;
    	overflow: hidden;
    	text-overflow: ellipsis;
    	height: 1.75em;
    	white-space: nowrap;
    }
    
    .bookmark-text {
    	display: flex;
    	flex-direction: column;
    }
    
    .bookmark-info {
    	flex: 4 1 180px;
    	padding: 12px 14px 14px;
    	display: flex;
    	flex-direction: column;
    	justify-content: space-between;
    }
    
    .bookmark-image {
    	width: 33%;
    	flex: 1 1 180px;
    	display: block;
    	position: relative;
    	object-fit: cover;
    	border-radius: 1px;
    }
    
    .bookmark-description {
    	color: rgba(55, 53, 47, 0.6);
    	font-size: 0.75em;
    	overflow: hidden;
    	max-height: 4.5em;
    	word-break: break-word;
    }
    
    .bookmark-href {
    	font-size: 0.75em;
    	margin-top: 0.25em;
    }
    
    .sans { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; }
    .code { font-family: "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace; }
    .serif { font-family: Lyon-Text, Georgia, ui-serif, serif; }
    .mono { font-family: iawriter-mono, Nitti, Menlo, Courier, monospace; }
    .pdf .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK JP'; }
    .pdf:lang(zh-CN) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK SC'; }
    .pdf:lang(zh-TW) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK TC'; }
    .pdf:lang(ko-KR) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK KR'; }
    .pdf .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK JP'; }
    .pdf:lang(zh-CN) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK SC'; }
    .pdf:lang(zh-TW) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK TC'; }
    .pdf:lang(ko-KR) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK KR'; }
    .pdf .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK JP'; }
    .pdf:lang(zh-CN) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK SC'; }
    .pdf:lang(zh-TW) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK TC'; }
    .pdf:lang(ko-KR) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK KR'; }
    .pdf .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK JP'; }
    .pdf:lang(zh-CN) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK SC'; }
    .pdf:lang(zh-TW) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK TC'; }
    .pdf:lang(ko-KR) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK KR'; }
    .highlight-default {
    	color: rgba(55, 53, 47, 1);
    }
    .highlight-gray {
    	color: rgba(120, 119, 116, 1);
    	fill: rgba(120, 119, 116, 1);
    }
    .highlight-brown {
    	color: rgba(159, 107, 83, 1);
    	fill: rgba(159, 107, 83, 1);
    }
    .highlight-orange {
    	color: rgba(217, 115, 13, 1);
    	fill: rgba(217, 115, 13, 1);
    }
    .highlight-yellow {
    	color: rgba(203, 145, 47, 1);
    	fill: rgba(203, 145, 47, 1);
    }
    .highlight-teal {
    	color: rgba(68, 131, 97, 1);
    	fill: rgba(68, 131, 97, 1);
    }
    .highlight-blue {
    	color: rgba(51, 126, 169, 1);
    	fill: rgba(51, 126, 169, 1);
    }
    .highlight-purple {
    	color: rgba(144, 101, 176, 1);
    	fill: rgba(144, 101, 176, 1);
    }
    .highlight-pink {
    	color: rgba(193, 76, 138, 1);
    	fill: rgba(193, 76, 138, 1);
    }
    .highlight-red {
    	color: rgba(212, 76, 71, 1);
    	fill: rgba(212, 76, 71, 1);
    }
    .highlight-gray_background {
    	background: rgba(241, 241, 239, 1);
    }
    .highlight-brown_background {
    	background: rgba(244, 238, 238, 1);
    }
    .highlight-orange_background {
    	background: rgba(251, 236, 221, 1);
    }
    .highlight-yellow_background {
    	background: rgba(251, 243, 219, 1);
    }
    .highlight-teal_background {
    	background: rgba(237, 243, 236, 1);
    }
    .highlight-blue_background {
    	background: rgba(231, 243, 248, 1);
    }
    .highlight-purple_background {
    	background: rgba(244, 240, 247, 0.8);
    }
    .highlight-pink_background {
    	background: rgba(249, 238, 243, 0.8);
    }
    .highlight-red_background {
    	background: rgba(253, 235, 236, 1);
    }
    .block-color-default {
    	color: inherit;
    	fill: inherit;
    }
    .block-color-gray {
    	color: rgba(120, 119, 116, 1);
    	fill: rgba(120, 119, 116, 1);
    }
    .block-color-brown {
    	color: rgba(159, 107, 83, 1);
    	fill: rgba(159, 107, 83, 1);
    }
    .block-color-orange {
    	color: rgba(217, 115, 13, 1);
    	fill: rgba(217, 115, 13, 1);
    }
    .block-color-yellow {
    	color: rgba(203, 145, 47, 1);
    	fill: rgba(203, 145, 47, 1);
    }
    .block-color-teal {
    	color: rgba(68, 131, 97, 1);
    	fill: rgba(68, 131, 97, 1);
    }
    .block-color-blue {
    	color: rgba(51, 126, 169, 1);
    	fill: rgba(51, 126, 169, 1);
    }
    .block-color-purple {
    	color: rgba(144, 101, 176, 1);
    	fill: rgba(144, 101, 176, 1);
    }
    .block-color-pink {
    	color: rgba(193, 76, 138, 1);
    	fill: rgba(193, 76, 138, 1);
    }
    .block-color-red {
    	color: rgba(212, 76, 71, 1);
    	fill: rgba(212, 76, 71, 1);
    }
    .block-color-gray_background {
    	background: rgba(241, 241, 239, 1);
    }
    .block-color-brown_background {
    	background: rgba(244, 238, 238, 1);
    }
    .block-color-orange_background {
    	background: rgba(251, 236, 221, 1);
    }
    .block-color-yellow_background {
    	background: rgba(251, 243, 219, 1);
    }
    .block-color-teal_background {
    	background: rgba(237, 243, 236, 1);
    }
    .block-color-blue_background {
    	background: rgba(231, 243, 248, 1);
    }
    .block-color-purple_background {
    	background: rgba(244, 240, 247, 0.8);
    }
    .block-color-pink_background {
    	background: rgba(249, 238, 243, 0.8);
    }
    .block-color-red_background {
    	background: rgba(253, 235, 236, 1);
    }
    .select-value-color-pink { background-color: rgba(245, 224, 233, 1); }
    .select-value-color-purple { background-color: rgba(232, 222, 238, 1); }
    .select-value-color-green { background-color: rgba(219, 237, 219, 1); }
    .select-value-color-gray { background-color: rgba(227, 226, 224, 1); }
    .select-value-color-opaquegray { background-color: rgba(255, 255, 255, 0.0375); }
    .select-value-color-orange { background-color: rgba(250, 222, 201, 1); }
    .select-value-color-brown { background-color: rgba(238, 224, 218, 1); }
    .select-value-color-red { background-color: rgba(255, 226, 221, 1); }
    .select-value-color-yellow { background-color: rgba(253, 236, 200, 1); }
    .select-value-color-blue { background-color: rgba(211, 229, 239, 1); }
    
    .checkbox {
    	display: inline-flex;
    	vertical-align: text-bottom;
    	width: 16;
    	height: 16;
    	background-size: 16px;
    	margin-left: 2px;
    	margin-right: 5px;
    }
    
    .checkbox-on {
    	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%2358A9D7%22%2F%3E%0A%3Cpath%20d%3D%22M6.71429%2012.2852L14%204.9995L12.7143%203.71436L6.71429%209.71378L3.28571%206.2831L2%207.57092L6.71429%2012.2852Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E");
    }
    
    .checkbox-off {
    	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%220.75%22%20y%3D%220.75%22%20width%3D%2214.5%22%20height%3D%2214.5%22%20fill%3D%22white%22%20stroke%3D%22%2336352F%22%20stroke-width%3D%221.5%22%2F%3E%0A%3C%2Fsvg%3E");
    }
    	
    </style></head><body><article id="83b552ae-fba5-4021-9391-885d74a3bed6" class="page sans"><header><h1 class="page-title">417 - Welcome &amp; where to start</h1></header><div class="page-body"><h2 id="d97fec96-e123-4219-aba2-49013d4e1f09" class="">Welcome to 417!</h2><p id="3768169c-b40a-4dd2-b98e-bc5d486bdd48" class="">Below is the “recommended setup” that we will use to run automated tests on. It is <strong>your responsibility</strong> to ensure that your code works on this setup, as the operation of your code may differ based on the compiler version used, glibc version used, third-party library version used, etc. Please ensure that your code works as intended when it is ran in the setup described below.</p><p id="0cff2d82-4615-47a3-b844-c3c0aab11562" class="">
    </p><p id="d75fd108-c3bf-458b-b87f-eedae7f1a1d8" class="">Do note that you <em>are</em> allowed to create your own setup as per your own preferences to work on, we are asking you to just  test them in the below environment to ensure that it <em>actually</em> works. (Test before you submit!)</p><p id="5e94169f-5342-4f97-ad10-0f012fcb6d95" class="">
    </p><p id="bfac9cce-96f0-4efb-b3ff-7d6b5a348252" class="">You will submit the project as a stack of commits in your assigned git repository. The last commit that was made before the deadline will be graded.</p><p id="e41de233-9123-4d5d-b63e-934ec7666468" class="">
    </p><hr id="30db3c7c-4498-426d-8477-f6074907f47c"/><h3 id="18609eb3-6a6d-4203-a19c-18ad5dce0e4e" class="">Signing in to GitLab and generating SSH keys</h3><p id="aa744e9f-0b20-473c-a3f1-2c9dcb471d8e" class="">We will be using GitLab for all submissions. Please sign in to <a href="https://gitlab.cs.umd.edu">https://gitlab.cs.umd.edu</a> by clicking on the <code>UMD CAS Login</code> button, and <strong>ensure that your GitLab username matches your directory ID</strong> (<code><span style="border-bottom:0.05em solid"><strong><em>this_part</em></strong></span></code><code>@terpmail.umd.edu</code>).</p><p id="f874b8cf-d164-42ea-8f12-5400868dd330" class="">Then, add an SSH key to your account by following the guide here: </p><figure id="bb768de5-7800-44a2-988c-4fde0c2d21a9"><a href="https://docs.gitlab.com/ee/user/ssh.html" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">Use SSH keys to communicate with GitLab | GitLab</div><div class="bookmark-description">Git is a distributed version control system, which means you can work locally, then share or push your changes to a server. In this case, the server you push to is GitLab. GitLab uses the SSH protocol to securely communicate with Git.</div></div><div class="bookmark-href"><img src="https://docs.gitlab.com/favicon.ico" class="icon bookmark-icon"/>https://docs.gitlab.com/ee/user/ssh.html</div></div></a></figure><p id="8c43f6ee-021e-415e-b104-4c67d54b136b" class="">The file <code>id_ed25519</code> (no extension) is your <strong>private</strong> key. Treat this like your password and don’t share it with anyone!</p><p id="18c23364-89b8-4188-85ea-c207a43b9b48" class="">The file <code>id_ed25519.pub</code> is your public key. This is the one you register on Gitlab by going to <code>Preferences (User Settings)</code>&gt; <code>SSH Keys</code>.</p><p id="e80e8776-54be-4d00-8066-a1264bef13b4" class="">
    </p><hr id="6dee9e71-20c3-4b74-a5f9-c21e12e1fb1f"/><h3 id="015d842a-7561-40c4-8971-2e791ee0a55f" class="">Installing Docker</h3><p id="e05c6c9b-66ee-4dd3-b8e3-7097a854f4c1" class="">Go to <a href="https://docs.docker.com/get-docker/">https://docs.docker.com/get-docker/</a> to install Docker. If docker is already installed on your computer, you can skip this step.</p><p id="f1ed4144-9d8a-4d71-ac85-7597a62eb963" class="">If you’re on Windows, make sure to turn on WSL2 integration. More on that here: </p><figure id="0c68d6af-b147-41c8-bcd2-6a68a3f008b9"><a href="https://docs.docker.com/desktop/windows/wsl/" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">Docker Desktop WSL 2 backend on Windows</div><div class="bookmark-description">Windows Subsystem for Linux (WSL) 2 is a full Linux kernel built by Microsoft, which allows Linux distributions to run without managing virtual machines. With Docker Desktop running on WSL 2, users can leverage Linux workspaces and avoid maintaining both Linux and Windows build scripts.</div></div><div class="bookmark-href"><img src="https://docs.docker.com/assets/favicons/docs@2x.ico" class="icon bookmark-icon"/>https://docs.docker.com/desktop/windows/wsl/</div></div><img src="https://docs.docker.com/assets/favicons/docs@2x.ico" class="bookmark-image"/></a></figure><p id="8c5f72dd-cf70-4ac9-864b-ec74c5e57da2" class="">Then, run our setup script by entering below commands in your command-line.</p><pre id="7cfb7c77-b2b3-4693-a516-34ddf3755871" class="code"><code># replace `~/Desktop` with a directory you want to work on
    cd ~/Desktop
    # install `curl` if below command doesn&#x27;t work
    curl &#x27;https://gitlab.cs.umd.edu/-/snippets/116/raw/main/417docker.sh&#x27; -OJ
    # never run shell scripts that you don&#x27;t understand!
    cat 417docker.sh
    # make script runnable
    chmod +x 417docker.sh
    # run the script
    ./417docker.sh</code></pre><p id="6adaf39b-67fc-451c-a64f-a987222f1aa1" class="">The script sets up a Debian 10 container, installs all necessary dependencies, and creates a user named <code>student</code> with sudo privileges. You can code, compile, and test in this container.</p><p id="3ab7ae53-8ef0-4862-8ee5-7aced608fbd5" class="">You will now see a directory named <code>CMSC417</code> on your <code>~/Desktop</code> (or wherever you ran the script on). This directory is shared as the home directory for <code>student</code> user in the Docker container, so that you can easily move files around.</p><p id="1f909ca5-79cd-4ab1-9390-b88451b0a279" class="">The script should have put you on a shell running inside the Docker container. Run <code>cat /etc/os-release</code> in your container shell and check if the output matches exactly as below:</p><pre id="9b031d6c-8b1a-4c2a-afe8-3174ec9da82c" class="code"><code>PRETTY_NAME=&quot;Debian GNU/Linux 10 (buster)&quot;
    NAME=&quot;Debian GNU/Linux&quot;
    VERSION_ID=&quot;10&quot;
    VERSION=&quot;10 (buster)&quot;
    VERSION_CODENAME=buster
    ID=debian
    HOME_URL=&quot;&lt;https://www.debian.org/&gt;&quot;
    SUPPORT_URL=&quot;&lt;https://www.debian.org/support&gt;&quot;
    BUG_REPORT_URL=&quot;&lt;https://bugs.debian.org/&gt;&quot;</code></pre><p id="2a75dda7-a6b1-459f-b2bd-fcf91be5ab69" class="">Also check if file sharing is working as expected. In the shell of your Docker container, do:</p><pre id="e60fbd18-b6f6-4953-a652-890b92612fd9" class="code"><code># this creates empty file named asdf.txt
    cd &amp;&amp; touch asdf.txt</code></pre><p id="0baab1ba-11db-42e2-9761-a0b89b9a5288" class="">And ensure that you can see this file in your <strong>host’s</strong> <code>CMSC417</code> directory (you may delete this file after checking that it works.</p><p id="8f4fbe66-7f49-4af3-9b6a-bc9d8347a57c" class="">
    </p><hr id="5200f5ac-4019-4ad6-9d96-0caf6cdc9d88"/><h3 id="fc694008-d19c-47b4-8730-20e42f21d252" class="">Working with containers in VSCode</h3><p id="6185ff03-82f2-4073-8db6-5bc734021e9d" class="">You may use any editor you’d like, but if you don’t have any preferences, I would recommend trying Visual Studio Code, as it has great Docker integration. You can get it from:</p><figure id="e03145e0-914c-4ab9-b6dd-49a53e0783c3"><a href="https://code.visualstudio.com/download" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">Download Visual Studio Code - Mac, Linux, Windows</div><div class="bookmark-description">Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.</div></div><div class="bookmark-href"><img src="https://code.visualstudio.com/favicon.ico" class="icon bookmark-icon"/>https://code.visualstudio.com/download</div></div><img src="https://code.visualstudio.com/opengraphimg/opengraph-home.png" class="bookmark-image"/></a></figure><p id="72ea2dd2-0ba3-4d77-acf2-f6a2b94b0268" class="">Then, install remote containers plugin:</p><figure id="ced328ee-ee1e-41bb-a632-da19bcc974d0"><a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">Dev Containers - Visual Studio Marketplace</div><div class="bookmark-description">The Dev Containers extension lets you use a Docker container as a full-featured development environment. Whether you deploy to containers or not, containers make a great development environment because you can: Develop with a consistent, easily reproducible toolchain on the same operating system you deploy to.</div></div><div class="bookmark-href"><img src="https://marketplace.visualstudio.com/favicon.ico" class="icon bookmark-icon"/>https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers</div></div><img src="https://ms-vscode-remote.gallerycdn.vsassets.io/extensions/ms-vscode-remote/remote-containers/0.277.0/1675690849463/Microsoft.VisualStudio.Services.Icons.Default" class="bookmark-image"/></a></figure><p id="ad2f9872-77a8-4b92-8674-770005a0d0c1" class="">Press <code>Ctrl+Shift+P</code> (<code>Cmd+Shift+P</code> on macOS) to open command palette, and type <code>attach to running container</code>. Press <code>enter</code>.</p><p id="20a00a01-9ee0-4e39-89be-b0f0c1e6b393" class="">(Linux only) if you see permission errors, run this on your host shell and reboot: <code>sudo usermod -aG docker $USER</code></p><p id="e9a2e171-bcf8-4913-bcca-8d99c88d82f7" class="">Select <code>cmsc417container</code> and press enter. Now your VSCode runs inside the container environment!</p><p id="75438987-d5f4-4163-9711-abe2b1ce3dbc" class="">Once you have done this, the remote indicator on the left bottom (green in default theme) should indicate that you’re running inside the container. You may have to re-run <code>attach to running container</code> every time you close and re-open VSCode.</p><hr id="94eebf06-a599-4c2a-9940-21f909562623"/><h3 id="e6b7b374-51f9-45bf-a803-a7f18fbca620" class="">Setting up git/ssh in containers</h3><p id="3615672c-21a7-42fe-91ea-e1af950a6538" class="">In your container, create the <code>.ssh</code> directory with command below:</p><pre id="1c9adc35-d4be-4982-9bf5-2f4d1b031d13" class="code"><code>mkdir -p ~/.ssh
    chmod 700 ~/.ssh</code></pre><p id="64bd73b7-7f72-49af-bd2d-cfb949aa9d6c" class="">Now, on your host, find the shared directory and open the <code>.ssh</code> directory you just created (e.g. <code>CMSC417/.ssh</code>). Then find the <code>id_ed25519</code> file you created in above step (the file I told you to treat like your password) and copy it into here so your container can have access to your remote Git repository.</p><p id="62e220ab-212a-41f1-93a8-3a86578f51ba" class="">Then, on your shell, run:</p><pre id="bb5fdb30-1adf-4069-a4c0-6a2fd7a93c30" class="code"><code>chmod 600 ~/.ssh/*</code></pre><hr id="12318781-29fb-4d25-84b1-4d02c8031673"/><h3 id="0147fb1e-9859-404f-902a-f81c8b8f4efe" class="">Checking if you have access</h3><p id="80e73804-4eda-4086-b621-fde55cce3193" class="">Navigate to <code>https://gitlab.cs.umd.edu/cmsc417-s23/students/your_directory_id</code> and see if you have access (no assignments are released yet, so things being empty is fine. however, you should be able to see the page itself. If you don’t have access, email the TAs ASAP)</p><p id="1cc0c37e-7656-4acb-a5f5-97f8a4a3fac6" class="">
    </p></div></article></body></html>
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment